qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 3/9] CLI: add -preconfig option


From: Igor Mammedov
Subject: Re: [Qemu-devel] [PATCH v3 3/9] CLI: add -preconfig option
Date: Wed, 28 Feb 2018 16:54:44 +0100

On Tue, 27 Feb 2018 14:39:22 -0600
Eric Blake <address@hidden> wrote:

> On 02/16/2018 06:37 AM, Igor Mammedov wrote:
> > Option allows to pause QEMU at new RUN_STATE_PRECONFIG time,
> > which would allow to configure QEMU from QMP before machine
> > jumps into board initialization code machine_run_board_init().  
> 
> Grammar suggestion:
> 
> This option allows pausing QEMU in the new RUN_STATE_PRECONFIG state, 
> allowing the configuration of QEMU from QMP before the machine jumps 
> into board initialization code of machine_run_board_init().
> 
> > 
> > Intent is to allow management to query machine state and
> > additionally configure it using previous query results
> > within one QEMU instance (i.e. eliminate need to start QEMU
> > twice, 1st to query board specific parameters and 2nd for
> > for actual VM start using query result for additional
> > parameters).
> > 
> > Initially it's planned to be used for configuring numa
> > topology depending on cpu layout.  
> 
> It may be worth mentioning in the commit message how this differs from 
> -S, and what the QMP client must do to get the guest started in this 
> mode to enter the normal lifecycle that it used to have when using -S.
> 
> > 
> > Signed-off-by: Igor Mammedov <address@hidden>
> > ---
> >   include/sysemu/sysemu.h |  1 +
> >   qapi/run-state.json     |  3 ++-
> >   qemu-options.hx         | 11 +++++++++++
> >   qmp.c                   |  5 +++++
> >   vl.c                    | 35 ++++++++++++++++++++++++++++++++++-
> >   5 files changed, 53 insertions(+), 2 deletions(-)
> >   
> 
> > +++ b/qapi/run-state.json
> > @@ -49,12 +49,13 @@
> >   # @colo: guest is paused to save/restore VM state under colo checkpoint,
> >   #        VM can not get into this state unless colo capability is enabled
> >   #        for migration. (since 2.8)
> > +# @preconfig: QEMU is paused before machine is created.  
> 
> Needs a '(since 2.12)' tag.  Probably also be worth mentioning that this 
> state is only visible for clients that pass the new CLI option.
> 
> > +++ b/qemu-options.hx
> > @@ -3283,6 +3283,17 @@ STEXI
> >   Run the emulation in single step mode.
> >   ETEXI
> >   
> > +DEF("preconfig", 0, QEMU_OPTION_preconfig, \
> > +    "-preconfig      pause QEMU before machine is initialized\n",
> > +    QEMU_ARCH_ALL)
> > +STEXI
> > address@hidden -preconfig
> > address@hidden -preconfig
> > +Pause QEMU for interactive configuration before machine is created,
> > +which allows to query and configure properties affecting machine
> > +initialization. Use QMP command 'cont' to exit paused state.  
> 
> Pause QEMU for interactive configuration before the machine is created, 
> which allows querying and configuring properties that will affect 
> machine initialization.  Use the QMP command 'cont' to exit the 
> preconfig state.
Thanks,
I'll fix all of above on respin.

> Hmm - can you also transition from preconfig to the normal paused state 
> via 'stop', which you would do to emit other commands that you used to 
> issue between the older 'qemu -S' and the 'cont'?
Both -preconfig and -S could be used together on CLI to
achieve above effect, where 'cont' would transition state
to the next requested state (i.e. if -S specified QEMU will do
second pause where it used to do and if there is no -S on
CLI machine will start to execute guest code).

I'm not sure about suggested 'stop' behavior though,
wouldn't it be confusing since it would actually do
something beside pausing and from already paused state
at that?
I've opted for adding as little as possible of new behavior,
and 'cont' looked like a reasonable choice.
 



reply via email to

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