All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: quintela@redhat.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [PATCH] Split machine creation from the main loop
Date: Wed, 23 Feb 2011 18:36:45 -0600	[thread overview]
Message-ID: <4D65A81D.4090407@codemonkey.ws> (raw)
In-Reply-To: <m3zkpm1fuf.fsf@trasno.org>

On 02/23/2011 05:38 PM, Juan Quintela wrote:
> Anthony Liguori<anthony@codemonkey.ws>  wrote:
>    
>> On 02/23/2011 05:00 PM, Juan Quintela wrote:
>>      
>>> Anthony Liguori<aliguori@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<aliguori@us.ibm.com>
>>>>
>>>>          
>>> 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	other threads:[~2011-02-24  0:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 21:38 [Qemu-devel] [PATCH] Split machine creation from the main loop Anthony Liguori
2011-02-23 23:00 ` [Qemu-devel] " Juan Quintela
2011-02-23 23:12   ` Anthony Liguori
2011-02-23 23:38     ` Juan Quintela
2011-02-24  0:36       ` Anthony Liguori [this message]
2011-02-24 10:19         ` Stefan Hajnoczi
2011-02-24 14:47           ` Anthony Liguori
2011-02-24 16:01     ` Avi Kivity
2011-02-24 17:25       ` Anthony Liguori
2011-02-27 11:33         ` Avi Kivity
2011-02-28  4:01           ` Anthony Liguori
2011-02-28  8:20             ` Avi Kivity
2011-02-28  8:57               ` Paolo Bonzini
2011-02-28  9:13                 ` Avi Kivity
2011-02-28 10:08                   ` Paolo Bonzini
2011-02-28 12:08                   ` Anthony Liguori
2011-02-25 17:02 ` [Qemu-devel] " Blue Swirl

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=4D65A81D.4090407@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.