summaryrefslogtreecommitdiff
path: root/include/hw/boards.h
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-03-13 12:32:47 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-03-13 12:32:47 +0000
commitc8d146aecceb560664b112279ffddf6fe1db99db (patch)
treeee6ad1ab9701df1b9fb69be823b0a6ac9cd03933 /include/hw/boards.h
parent0100f42550201f346cc0c20c1864f941509eb592 (diff)
parentf8762027a33e2f5d0915c56a904962b1481f75c1 (diff)
downloadqemu-c8d146aecceb560664b112279ffddf6fe1db99db.tar.gz
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM/QTest infrastructure fixes and device conversions * QTest cleanups and test cases for some virtio devices * QTest for sPAPR PCI host bridge * qom-test now tests reading all properties beneath /machine * QOM API leak fixes * QOM cleanups for SSI devices * QOM conversion of QEMUMachine * QOM realize for buses * sPAPR PCI bus name change # gpg: Signature made Thu 13 Mar 2014 00:22:40 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-peter: (31 commits) libqtest: Fix possible deadlock in qtest initialization pci: Move VMState registration/unregistration to QOM realize/unrealize qdev: Realize buses on device realization qdev: Prepare realize/unrealize hooks for BusState tests: Add spapr-pci-host-bridge qtest virtio-serial-port: Convert to QOM realize/unrealize virtio-console: QOM cast cleanup for VirtConsole tests: Add virtio-console qtest tests: Add virtio-serial qtest tests: Add virtio-scsi qtest tests: Add virtio-rng qtest tests: Add virtio-balloon qtest tests: Add virtio-blk qtest tests: Clean up IndustryPack TPCI200 gcov paths qom-test: Test QOM properties hw/boards: Convert current_machine to MachineState vl: Use MachineClass instead of global QEMUMachine list hw/core: Introduce QEMU machine as QOM object qdev-monitor-test: Don't test human-readable error message qdev-monitor-test: Simplify using g_assert_cmpstr() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/hw/boards.h')
-rw-r--r--include/hw/boards.h55
1 files changed, 53 insertions, 2 deletions
diff --git a/include/hw/boards.h b/include/hw/boards.h
index c2096e6ba2..6b17397e8d 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -6,6 +6,7 @@
#include "sysemu/blockdev.h"
#include "sysemu/qemumachine.h"
#include "hw/qdev.h"
+#include "qom/object.h"
typedef struct QEMUMachineInitArgs {
const QEMUMachine *machine;
@@ -50,9 +51,59 @@ struct QEMUMachine {
const char *hw_version;
};
+#define TYPE_MACHINE_SUFFIX "-machine"
int qemu_register_machine(QEMUMachine *m);
-QEMUMachine *find_default_machine(void);
-extern QEMUMachine *current_machine;
+#define TYPE_MACHINE "machine"
+#define MACHINE(obj) \
+ OBJECT_CHECK(MachineState, (obj), TYPE_MACHINE)
+#define MACHINE_GET_CLASS(obj) \
+ OBJECT_GET_CLASS(MachineClass, (obj), TYPE_MACHINE)
+#define MACHINE_CLASS(klass) \
+ OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE)
+
+typedef struct MachineState MachineState;
+typedef struct MachineClass MachineClass;
+
+MachineClass *find_default_machine(void);
+extern MachineState *current_machine;
+
+/**
+ * MachineClass:
+ * @qemu_machine: #QEMUMachine
+ */
+struct MachineClass {
+ /*< private >*/
+ ObjectClass parent_class;
+ /*< public >*/
+
+ QEMUMachine *qemu_machine;
+};
+
+/**
+ * MachineState:
+ */
+struct MachineState {
+ /*< private >*/
+ Object parent_obj;
+ /*< public >*/
+
+ char *accel;
+ bool kernel_irqchip;
+ int kvm_shadow_mem;
+ char *kernel;
+ char *initrd;
+ char *append;
+ char *dtb;
+ char *dumpdtb;
+ int phandle_start;
+ char *dt_compatible;
+ bool dump_guest_core;
+ bool mem_merge;
+ bool usb;
+ char *firmware;
+
+ QEMUMachineInitArgs init_args;
+};
#endif