Il 20/02/2014 14:50, Alexey Kardashevskiy ha scritto:
From: Paolo Bonzini <pbonz...@redhat.com>
This is a first step towards QOMifying /machine.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
The patch was originally mine, so I could get it in if Andreas wants me
to handle patches 2-3. But for anyone else it would be missing your
S-o-b line.
Paolo
---
include/hw/boards.h | 1 +
vl.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index c2096e6..8640272 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -29,6 +29,7 @@ struct QEMUMachine {
const char *name;
const char *alias;
const char *desc;
+ const char *class_name;
QEMUMachineInitFunc *init;
QEMUMachineResetFunc *reset;
QEMUMachineHotAddCPUFunc *hot_add_cpu;
diff --git a/vl.c b/vl.c
index 01ab7e4..b300721 100644
--- a/vl.c
+++ b/vl.c
@@ -4034,6 +4034,11 @@ int main(int argc, char **argv, char **envp)
qtest_init(qtest_chrdev, qtest_log);
}
+ if (machine->class_name) {
+ Object *m = object_new(machine->class_name);
+ object_property_add_child(object_get_root(), "machine", m, NULL);
+ }
+
machine_opts = qemu_get_machine_opts();
kernel_filename = qemu_opt_get(machine_opts, "kernel");
initrd_filename = qemu_opt_get(machine_opts, "initrd");