qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH RFC 02/11] vl: Drop x-exit-preconfig


From: Markus Armbruster
Subject: [PATCH RFC 02/11] vl: Drop x-exit-preconfig
Date: Thu, 2 Dec 2021 08:04:41 +0100

The startup code is split between qemu_init() and
qmp_x_exit_preconfig().  Cutting off the CLI leaves the QMP command
useless.  Drop it, and inline the startup code back into qemu_init().
I'm going to provide more general replacement shortly.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qapi/misc.json     | 27 -------------------------
 monitor/hmp-cmds.c |  8 --------
 softmmu/vl.c       | 50 ++++++++++++++++++----------------------------
 hmp-commands.hx    | 18 -----------------
 4 files changed, 19 insertions(+), 84 deletions(-)

diff --git a/qapi/misc.json b/qapi/misc.json
index 358548abe1..45e6ee104e 100644
--- a/qapi/misc.json
+++ b/qapi/misc.json
@@ -174,33 +174,6 @@
 ##
 { 'command': 'cont' }
 
-##
-# @x-exit-preconfig:
-#
-# Exit from "preconfig" state
-#
-# This command makes QEMU exit the preconfig state and proceed with
-# VM initialization using configuration data provided on the command line
-# and via the QMP monitor during the preconfig state. The command is only
-# available during the preconfig state (i.e. when the --preconfig command
-# line option was in use).
-#
-# Features:
-# @unstable: This command is experimental.
-#
-# Since 3.0
-#
-# Returns: nothing
-#
-# Example:
-#
-# -> { "execute": "x-exit-preconfig" }
-# <- { "return": {} }
-#
-##
-{ 'command': 'x-exit-preconfig', 'allow-preconfig': true,
-  'features': [ 'unstable' ] }
-
 ##
 # @human-monitor-command:
 #
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 9c91bf93e9..6865ed6010 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -931,14 +931,6 @@ void hmp_system_powerdown(Monitor *mon, const QDict *qdict)
     qmp_system_powerdown(NULL);
 }
 
-void hmp_exit_preconfig(Monitor *mon, const QDict *qdict)
-{
-    Error *err = NULL;
-
-    qmp_x_exit_preconfig(&err);
-    hmp_handle_error(mon, err);
-}
-
 void hmp_cpu(Monitor *mon, const QDict *qdict)
 {
     int64_t cpu_index;
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 2bad7a437e..39c67b91c4 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -134,7 +134,6 @@ static const char *accelerators;
 static ram_addr_t maxram_size;
 static uint64_t ram_slots;
 static int display_remote;
-static bool preconfig_requested;
 static ram_addr_t ram_size;
 static DisplayOptions dpy;
 
@@ -945,34 +944,6 @@ static void qemu_machine_creation_done(void)
     }
 }
 
-void qmp_x_exit_preconfig(Error **errp)
-{
-    if (phase_check(PHASE_MACHINE_INITIALIZED)) {
-        error_setg(errp, "The command is permitted only before machine 
initialization");
-        return;
-    }
-
-    qemu_init_board();
-    qemu_machine_creation_done();
-
-    if (replay_mode != REPLAY_MODE_NONE) {
-        replay_vmstate_init();
-    }
-
-    if (incoming) {
-        Error *local_err = NULL;
-        if (strcmp(incoming, "defer") != 0) {
-            qmp_migrate_incoming(incoming, &local_err);
-            if (local_err) {
-                error_reportf_err(local_err, "-incoming %s: ", incoming);
-                exit(1);
-            }
-        }
-    } else if (autostart) {
-        qmp_cont(NULL);
-    }
-}
-
 void qemu_init(int argc, char **argv, char **envp)
 {
     MachineClass *machine_class;
@@ -1103,9 +1074,26 @@ void qemu_init(int argc, char **argv, char **envp)
         exit(0);
     }
 
-    if (!preconfig_requested) {
-        qmp_x_exit_preconfig(&error_fatal);
+    qemu_init_board();
+    qemu_machine_creation_done();
+
+    if (replay_mode != REPLAY_MODE_NONE) {
+        replay_vmstate_init();
     }
+
+    if (incoming) {
+        Error *local_err = NULL;
+        if (strcmp(incoming, "defer") != 0) {
+            qmp_migrate_incoming(incoming, &local_err);
+            if (local_err) {
+                error_reportf_err(local_err, "-incoming %s: ", incoming);
+                exit(1);
+            }
+        }
+    } else if (autostart) {
+        qmp_cont(NULL);
+    }
+
     qemu_init_displays();
     accel_setup_post(current_machine);
     os_setup_post();
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 70a9136ac2..838c1f5969 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -53,24 +53,6 @@ SRST
   Quit the emulator.
 ERST
 
-    {
-        .name       = "exit_preconfig",
-        .args_type  = "",
-        .params     = "",
-        .help       = "exit the preconfig state",
-        .cmd        = hmp_exit_preconfig,
-        .flags      = "p",
-    },
-
-SRST
-``exit_preconfig``
-  This command makes QEMU exit the preconfig state and proceed with
-  VM initialization using configuration data provided on the command line
-  and via the QMP monitor during the preconfig state. The command is only
-  available during the preconfig state (i.e. when the --preconfig command
-  line option was in use).
-ERST
-
     {
         .name       = "block_resize",
         .args_type  = "device:B,size:o",
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]