qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH] Split machine creation from the main loop


From: Anthony Liguori
Subject: Re: [Qemu-devel] Re: [PATCH] Split machine creation from the main loop
Date: Wed, 23 Feb 2011 18:36:45 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Lightning/1.0b1 Thunderbird/3.0.10

On 02/23/2011 05:38 PM, Juan Quintela wrote:
Anthony Liguori<address@hidden>  wrote:
On 02/23/2011 05:00 PM, Juan Quintela wrote:
Anthony Liguori<address@hidden>   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<address@hidden>

I agree that it is one step in the right direction, but we are still
calling qemu_machine_init() before calling the main_loop().

What is the plan from here?

1) Decouple QMP from qemu_machine_init().  This really requires the
introduction of the new QAPI server that exists outside of the chardev
infrastructure since chardevs are currently initialized in
qemu_machine_init().

2) Make qemu_machine_init() take no parameters and just reference
global state.
Any good idea how that global state is going to be stored?

I just want to be able to launch a qemu on a different machine and
migrate the "configuration" to it, for doing that, I really need what
values are different from default or anything like that.  So as you can
see, I am very interested on that work.

First step is to have everything go through QMP. If everything flows through QMP, we have a gateway that we can focus on.

What I'd like to do next is introduce the notion of a stateful config file. This config file is essentially a global database that can be used to store information about the guest from within QEMU.

So -name would become:

case QEMU_OPTION_name:
    qmp_set_name(optarg, NULL);
    break;
}

And qmp_set_name woudl be implemented as:

static const char *qemu_name;

void qmp_set_name(const char *name, Error **errp)
{
      qemu_name = name;
}

char *qmp_query_name(Error **errp)
{
     return qemu_strdup(qemu_name);
}

Now, to integrate this into the stateful config file, we would do something like:

void qmp_set_name(const char *name, Error **errp)
{
     qemu_set_config("global", "name", name);
}

char *qmp_query_name(Error **errp)
{
     return qemu_strdup(qemu_get_config("global", "name"));
}

This is a simplistic example and more complex examples have not been totally thought out, but this is where I'm looking to go.

Regards,

Anthony Liguori

Later, Juan.





reply via email to

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