From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PULL 21/21] machine: Eliminate QEMUMachine and qemu_register_machine()
Date: Sat, 19 Sep 2015 16:43:30 +0200 [thread overview]
Message-ID: <1442673810-2679-22-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1442673810-2679-1-git-send-email-afaerber@suse.de>
From: Eduardo Habkost <ehabkost@redhat.com>
The struct is not used anymore and can be eliminated.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
include/hw/boards.h | 27 ---------------------------
include/qemu/typedefs.h | 1 -
include/sysemu/blockdev.h | 2 +-
include/sysemu/sysemu.h | 2 +-
vl.c | 36 ------------------------------------
5 files changed, 2 insertions(+), 66 deletions(-)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 4fe2ce5..3e9a92c 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"
/* Machine class name that needs to be used for class-name-based machine
@@ -69,7 +43,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 97ac727..ce82c64 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 1f6ff8f..c439975 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -195,7 +195,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 3b92635..e211f6a 100644
--- a/vl.c
+++ b/vl.c
@@ -1429,42 +1429,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->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_strdup_printf(MACHINE_TYPE_NAME("%s"), m->name);
- 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.4
next prev parent reply other threads:[~2015-09-19 14:43 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-19 14:43 [Qemu-devel] [PULL 00/21] QOM devices patch queue 2015-09-19 Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 01/21] qom: Do not reuse errp after a possible error Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 02/21] qom: Fix invalid error check in property_get_str() Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 03/21] qdev: Do not use slow [*] expansion for GPIO creation Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 04/21] machine: MACHINE_TYPE_NAME macro Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 05/21] vexpress: Don't set name on abstract class Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 06/21] vexpress: Rename machine classes to use MACHINE_TYPE_NAME Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 07/21] arm: Rename virt machine class " Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 08/21] pseries: Rename machine class names " Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 09/21] s390-virtio: Rename machine class name " Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 10/21] s390: Rename s390-ccw-virtio-2.4 " Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 11/21] mac99: Use MACHINE_TYPE_NAME to encode class name Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 12/21] machine: Ensure all TYPE_MACHINE subclasses have the right suffix Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 13/21] machine: Set MachineClass::name automatically Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 14/21] exynos4: Use EXYNOS4210_NCPUS instead of max_cpus on error message Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 15/21] exynos4: Use MachineClass instead of exynos4_machines array Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 16/21] exynos4: Declare each QEMUMachine as a separate variable Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 17/21] machine: DEFINE_MACHINE() macro Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 18/21] mac_world: Break long line Andreas Färber
2015-09-19 15:14 ` Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 19/21] Use DEFINE_MACHINE() to register all machines Andreas Färber
2015-09-19 14:43 ` [Qemu-devel] [PULL 20/21] Revert use of DEFINE_MACHINE() for registrations of multiple machines Andreas Färber
2015-09-21 15:49 ` Eduardo Habkost
2015-09-21 15:52 ` Andreas Färber
2015-09-21 17:24 ` Eduardo Habkost
2015-09-21 17:57 ` Eduardo Habkost
2015-09-19 14:43 ` Andreas Färber [this message]
2015-09-19 16:56 ` [Qemu-devel] [PULL 00/21] QOM devices patch queue 2015-09-19 Peter Maydell
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=1442673810-2679-22-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).