From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRmGl-0007DX-4A for qemu-devel@nongnu.org; Tue, 18 Aug 2015 15:10:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRmGj-0005gU-VR for qemu-devel@nongnu.org; Tue, 18 Aug 2015 15:09:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRmGj-0005gC-P3 for qemu-devel@nongnu.org; Tue, 18 Aug 2015 15:09:57 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 82A888E4EB for ; Tue, 18 Aug 2015 19:09:57 +0000 (UTC) From: Eduardo Habkost Date: Tue, 18 Aug 2015 12:08:54 -0700 Message-Id: <1439924934-30491-8-git-send-email-ehabkost@redhat.com> In-Reply-To: <1439924934-30491-1-git-send-email-ehabkost@redhat.com> References: <1439924934-30491-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 7/7] machine: Eliminate QEMUMachine and qemu_register_machine() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , "Michael S. Tsirkin" The struct is not used anymore and can be eliminated. Signed-off-by: Eduardo Habkost --- include/hw/boards.h | 27 --------------------------- include/qemu/typedefs.h | 1 - include/sysemu/blockdev.h | 2 +- include/sysemu/sysemu.h | 2 +- vl.c | 37 ------------------------------------- 5 files changed, 2 insertions(+), 67 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 95bcecd..2342a88 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -9,36 +9,10 @@ #include "hw/qdev.h" #include "qom/object.h" - -typedef void QEMUMachineInitFunc(MachineState *ms); - -typedef void QEMUMachineResetFunc(void); - -typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp); - -typedef int QEMUMachineGetKvmtypeFunc(const char *arg); - -struct QEMUMachine { - const char *name; - const char *desc; - QEMUMachineInitFunc *init; - QEMUMachineGetKvmtypeFunc *kvm_type; - BlockInterfaceType block_default_type; - int max_cpus; - unsigned int - no_sdcard:1, - has_dynamic_sysbus:1; - int is_default; - const char *default_machine_opts; - const char *default_boot_order; -}; - void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner, const char *name, uint64_t ram_size); -int qemu_register_machine(QEMUMachine *m); - #define TYPE_MACHINE_SUFFIX "-machine" #define TYPE_MACHINE "machine" #undef MACHINE /* BSD defines it and QEMU does not use it */ @@ -63,7 +37,6 @@ bool machine_mem_merge(MachineState *machine); /** * MachineClass: - * @qemu_machine: #QEMUMachine * @get_hotplug_handler: this function is called during bus-less * device hotplug. If defined it returns pointer to an instance * of HotplugHandler object, which handles hotplug operation diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index f8a9dd6..aea4aa8 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -67,7 +67,6 @@ typedef struct Property Property; typedef struct QEMUBH QEMUBH; typedef struct QemuConsole QemuConsole; typedef struct QEMUFile QEMUFile; -typedef struct QEMUMachine QEMUMachine; typedef struct QEMUSGList QEMUSGList; typedef struct QEMUSizedBuffer QEMUSizedBuffer; typedef struct QEMUTimerListGroup QEMUTimerListGroup; diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index 3104150..a00be94 100644 --- a/include/sysemu/blockdev.h +++ b/include/sysemu/blockdev.h @@ -20,7 +20,7 @@ void blockdev_auto_del(BlockBackend *blk); typedef enum { IF_DEFAULT = -1, /* for use with drive_add() only */ /* - * IF_IDE must be zero, because we want QEMUMachine member + * IF_IDE must be zero, because we want MachineClass member * block_default_type to default-initialize to IF_IDE */ IF_IDE = 0, diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 44570d1..c148283 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -194,7 +194,7 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex, void restore_boot_order(void *opaque); void validate_bootdevices(const char *devices, Error **errp); -/* handler to set the boot_device order for a specific type of QEMUMachine */ +/* handler to set the boot_device order for a specific type of MachineClass */ typedef void QEMUBootSetHandler(void *opaque, const char *boot_order, Error **errp); void qemu_register_boot_set(QEMUBootSetHandler *func, void *opaque); diff --git a/vl.c b/vl.c index 584ca88..0d535e1 100644 --- a/vl.c +++ b/vl.c @@ -1424,43 +1424,6 @@ void hmp_usb_del(Monitor *mon, const QDict *qdict) MachineState *current_machine; -/* - * Transitional class registration/init used for converting from - * legacy QEMUMachine to MachineClass. - */ -static void qemu_machine_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc = MACHINE_CLASS(oc); - QEMUMachine *qm = data; - mc->name = qm->name; - mc->desc = qm->desc; - mc->init = qm->init; - mc->kvm_type = qm->kvm_type; - mc->block_default_type = qm->block_default_type; - mc->max_cpus = qm->max_cpus; - mc->no_sdcard = qm->no_sdcard; - mc->has_dynamic_sysbus = qm->has_dynamic_sysbus; - mc->is_default = qm->is_default; - mc->default_machine_opts = qm->default_machine_opts; - mc->default_boot_order = qm->default_boot_order; -} - -int qemu_register_machine(QEMUMachine *m) -{ - char *name = g_strconcat(m->name, TYPE_MACHINE_SUFFIX, NULL); - TypeInfo ti = { - .name = name, - .parent = TYPE_MACHINE, - .class_init = qemu_machine_class_init, - .class_data = (void *)m, - }; - - type_register(&ti); - g_free(name); - - return 0; -} - static MachineClass *find_machine(const char *name) { GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false); -- 2.1.0