From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50878 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsPCB-00073a-9h for qemu-devel@nongnu.org; Wed, 23 Feb 2011 19:36:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PsPCA-00030k-0c for qemu-devel@nongnu.org; Wed, 23 Feb 2011 19:36:39 -0500 Received: from mail-vw0-f45.google.com ([209.85.212.45]:40452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsPC9-00030W-Ra for qemu-devel@nongnu.org; Wed, 23 Feb 2011 19:36:37 -0500 Received: by vws19 with SMTP id 19so12848vws.4 for ; Wed, 23 Feb 2011 16:36:37 -0800 (PST) Message-ID: <4D65A81D.4090407@codemonkey.ws> Date: Wed, 23 Feb 2011 18:36:45 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] Split machine creation from the main loop References: <1298497114-7436-1-git-send-email-aliguori@us.ibm.com> <4D65945A.3090106@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com Cc: qemu-devel@nongnu.org On 02/23/2011 05:38 PM, Juan Quintela wrote: > Anthony Liguori wrote: > >> On 02/23/2011 05:00 PM, Juan Quintela wrote: >> >>> Anthony Liguori 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 >>>> >>>> >>> 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. > >