From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhOBY-0008DJ-HP for qemu-devel@nongnu.org; Mon, 05 May 2014 15:04:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhOBM-0004xt-Eq for qemu-devel@nongnu.org; Mon, 05 May 2014 15:04:20 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 5 May 2014 21:03:47 +0200 Message-Id: <1399316644-20700-4-git-send-email-afaerber@suse.de> In-Reply-To: <1399316644-20700-1-git-send-email-afaerber@suse.de> References: <1399316644-20700-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 03/20] machine: Copy QEMUMachine's fields to MachineClass List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexander Graf , "open list:sPAPR" , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori , Marcel Apfelbaum From: Marcel Apfelbaum In order to eliminate the QEMUMachine indirection, add its fields directly to MachineClass. Do not yet remove qemu_machine field because it is still in use by sPAPR. Signed-off-by: Marcel Apfelbaum [AF: Copied fields for sPAPR, too] Signed-off-by: Andreas F=C3=A4rber --- hw/ppc/spapr.c | 24 ++++++++++++++++++++++++ include/hw/boards.h | 24 ++++++++++++++++++++++++ vl.c | 23 +++++++++++++++++++++++ 3 files changed, 71 insertions(+) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index a11e121..5192702 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1493,8 +1493,32 @@ static void spapr_machine_class_init(ObjectClass *= oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); FWPathProviderClass *fwc =3D FW_PATH_PROVIDER_CLASS(oc); + QEMUMachine *qm =3D data; =20 mc->qemu_machine =3D data; + + mc->name =3D qm->name; + mc->alias =3D qm->alias; + mc->desc =3D qm->desc; + mc->init =3D qm->init; + mc->reset =3D qm->reset; + mc->hot_add_cpu =3D qm->hot_add_cpu; + mc->kvm_type =3D qm->kvm_type; + mc->block_default_type =3D qm->block_default_type; + mc->max_cpus =3D qm->max_cpus; + mc->no_serial =3D qm->no_serial; + mc->no_parallel =3D qm->no_parallel; + mc->use_virtcon =3D qm->use_virtcon; + mc->use_sclp =3D qm->use_sclp; + mc->no_floppy =3D qm->no_floppy; + mc->no_cdrom =3D qm->no_cdrom; + mc->no_sdcard =3D qm->no_sdcard; + mc->is_default =3D qm->is_default; + mc->default_machine_opts =3D qm->default_machine_opts; + mc->default_boot_order =3D qm->default_boot_order; + mc->compat_props =3D qm->compat_props; + mc->hw_version =3D qm->hw_version; + fwc->get_dev_path =3D spapr_get_fw_dev_path; } =20 diff --git a/include/hw/boards.h b/include/hw/boards.h index aaaa871..c5f503d 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -77,6 +77,30 @@ struct MachineClass { /*< public >*/ =20 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; }; =20 /** diff --git a/vl.c b/vl.c index 236f95e..3229c2f 100644 --- a/vl.c +++ b/vl.c @@ -1588,8 +1588,31 @@ MachineState *current_machine; static void machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + QEMUMachine *qm =3D data; =20 mc->qemu_machine =3D data; + + mc->name =3D qm->name; + mc->alias =3D qm->alias; + mc->desc =3D qm->desc; + mc->init =3D qm->init; + mc->reset =3D qm->reset; + mc->hot_add_cpu =3D qm->hot_add_cpu; + mc->kvm_type =3D qm->kvm_type; + mc->block_default_type =3D qm->block_default_type; + mc->max_cpus =3D qm->max_cpus; + mc->no_serial =3D qm->no_serial; + mc->no_parallel =3D qm->no_parallel; + mc->use_virtcon =3D qm->use_virtcon; + mc->use_sclp =3D qm->use_sclp; + mc->no_floppy =3D qm->no_floppy; + mc->no_cdrom =3D qm->no_cdrom; + mc->no_sdcard =3D qm->no_sdcard; + mc->is_default =3D qm->is_default; + mc->default_machine_opts =3D qm->default_machine_opts; + mc->default_boot_order =3D qm->default_boot_order; + mc->compat_props =3D qm->compat_props; + mc->hw_version =3D qm->hw_version; } =20 int qemu_register_machine(QEMUMachine *m) --=20 1.8.4.5