qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: damien.hedde@greensocs.com, berrange@redhat.com,
	mark.burton@greensocs.com, edgar.iglesias@gmail.co,
	mirela.grujic@greensocs.com, marcandre.lureau@redhat.com,
	pbonzini@redhat.com, jsnow@redhat.com
Subject: [PATCH RFC 02/11] vl: Drop x-exit-preconfig
Date: Thu,  2 Dec 2021 08:04:41 +0100	[thread overview]
Message-ID: <20211202070450.264743-3-armbru@redhat.com> (raw)
In-Reply-To: <20211202070450.264743-1-armbru@redhat.com>

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



  parent reply	other threads:[~2021-12-02  7:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02  7:04 [PATCH RFC 00/11] vl: Explore redesign of startup Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 01/11] vl: Cut off the CLI with an axe Markus Armbruster
2021-12-02  7:04 ` Markus Armbruster [this message]
2021-12-02  7:04 ` [PATCH RFC 03/11] vl: Hardcode a QMP monitor on stdio for now Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 04/11] vl: Hardcode a VGA device " Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 05/11] vl: Demonstrate (bad) CLI wrapped around QMP Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 06/11] vl: Factor qemu_until_phase() out of qemu_init() Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 07/11] vl: Implement qemu_until_phase() running from arbitrary phase Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 08/11] vl: Implement qemu_until_phase() running to " Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 09/11] vl: New QMP command until-phase Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 10/11] vl: Disregard lack of 'allow-preconfig': true Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 11/11] vl: Enter main loop in phase @machine-initialized Markus Armbruster
2021-12-02 10:26 ` [PATCH RFC 00/11] vl: Explore redesign of startup Markus Armbruster
2021-12-07 16:52 ` Damien Hedde
2021-12-08  7:07   ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211202070450.264743-3-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=damien.hedde@greensocs.com \
    --cc=edgar.iglesias@gmail.co \
    --cc=jsnow@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mark.burton@greensocs.com \
    --cc=mirela.grujic@greensocs.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).