From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXwOk-0005W0-J5 for qemu-devel@nongnu.org; Wed, 09 Apr 2014 13:34:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXwOj-00073T-1X for qemu-devel@nongnu.org; Wed, 09 Apr 2014 13:34:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXwOi-000731-OW for qemu-devel@nongnu.org; Wed, 09 Apr 2014 13:34:52 -0400 From: Marcel Apfelbaum Date: Wed, 9 Apr 2014 20:34:50 +0300 Message-Id: <1397064893-11526-3-git-send-email-marcel.a@redhat.com> In-Reply-To: <1397064893-11526-1-git-send-email-marcel.a@redhat.com> References: <1397064893-11526-1-git-send-email-marcel.a@redhat.com> Subject: [Qemu-devel] [PATCH V3 2/5] vl.c: copy QEMUMachine's fields to MachineClass List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, famz@redhat.com, stefanha@redhat.com, stefano.stabellini@eu.citrix.com, alex@alex.org.uk, armbru@redhat.com, mst@redhat.com, agraf@suse.de, lcapitulino@redhat.com, aliguori@amazon.com, anthony.perard@citrix.com, pbonzini@redhat.com, afaerber@suse.de, rth@twiddle.net In order to eliminate the QEMUMachine indirection, add its fields directly to MachineClass. Do not remove yet qemu_machine field because it is still in use by sparpr. Signed-off-by: Marcel Apfelbaum --- include/hw/boards.h | 23 +++++++++++++++++++++++ vl.c | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/include/hw/boards.h b/include/hw/boards.h index aaaa871..138346d 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -77,6 +77,29 @@ struct MachineClass { /*< public >*/ QEMUMachine *qemu_machine; + const char *name; + const char *alias; + const char *desc; + + void (*init)(QEMUMachineInitArgs *args); + void (*reset)(void); + void (*hot_add_cpu)(const int64_t id, Error **errp); + int (*kvm_type)(const char *arg); + + BlockInterfaceType block_default_type; + int max_cpus; + unsigned int no_serial:1, + no_parallel:1, + use_virtcon:1, + use_sclp:1, + no_floppy:1, + no_cdrom:1, + no_sdcard:1; + int is_default; + const char *default_machine_opts; + const char *default_boot_order; + GlobalProperty *compat_props; + const char *hw_version; }; /** diff --git a/vl.c b/vl.c index 9975e5a..0b0202d 100644 --- a/vl.c +++ b/vl.c @@ -1583,8 +1583,31 @@ MachineState *current_machine; static void machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); + QEMUMachine *qm = data; mc->qemu_machine = data; + + mc->name = qm->name; + mc->alias = qm->alias; + mc->desc = qm->desc; + mc->init = qm->init; + mc->reset = qm->reset; + mc->hot_add_cpu = qm->hot_add_cpu; + mc->kvm_type = qm->kvm_type; + mc->block_default_type = qm->block_default_type; + mc->max_cpus = qm->max_cpus; + mc->no_serial = qm->no_serial; + mc->no_parallel = qm->no_parallel; + mc->use_virtcon = qm->use_virtcon; + mc->use_sclp = qm->use_sclp; + mc->no_floppy = qm->no_floppy; + mc->no_cdrom = qm->no_cdrom; + mc->no_sdcard = qm->no_sdcard; + mc->is_default = qm->is_default; + mc->default_machine_opts = qm->default_machine_opts; + mc->default_boot_order = qm->default_boot_order; + mc->compat_props = qm->compat_props; + mc->hw_version = qm->hw_version; } int qemu_register_machine(QEMUMachine *m) -- 1.8.3.1