On Wed, Feb 23, 2011 at 11:38 PM, Anthony Liguori <aligu...@us.ibm.com> wrote: > The goal is to enable the monitor to run independently of whether the machine > has been created such that the monitor can be used to specify all of the > parameters for machine initialization. > > Signed-off-by: Anthony Liguori <aligu...@us.ibm.com> > > diff --git a/vl.c b/vl.c > index b436952..181cc77 100644 > --- a/vl.c > +++ b/vl.c > @@ -1917,17 +1917,360 @@ static const QEMUOption *lookup_opt(int argc, char > **argv, > return popt; > } > > +static int qemu_machine_init(QEMUMachine *machine, const char > *kernel_filename, > + const char *kernel_cmdline, > + const char *initrd_filename, > + const char *boot_devices, const char *cpu_model, > + int snapshot, int tb_size, const char > *gdbstub_dev, > + const char *loadvm, const char *incoming)
qemu_machine_init() would mix host state initialization and machine initialization. I'd make instead two functions, qemu_host_init() and qemu_machine_init(). For example parameters snapshot, tb_size, gdbstub_dev, (maybe also loadvm and incoming if handled elsewhere) do not change how the machine is initialized. Also KVM, drive, chardev and display init should go to qemu_host_init() if possible.