hw/boards: Convert current_machine to MachineState
In order to allow attaching machine options to a machine instance,
current_machine is converted into MachineState.
As a first step of deprecating QEMUMachine, some of the functions
were modified to return MachineClass.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
diff --git a/qmp.c b/qmp.c
index f556a04..87a28f7 100644
--- a/qmp.c
+++ b/qmp.c
@@ -114,8 +114,11 @@
void qmp_cpu_add(int64_t id, Error **errp)
{
- if (current_machine->hot_add_cpu) {
- current_machine->hot_add_cpu(id, errp);
+ MachineClass *mc;
+
+ mc = MACHINE_GET_CLASS(current_machine);
+ if (mc->qemu_machine->hot_add_cpu) {
+ mc->qemu_machine->hot_add_cpu(id, errp);
} else {
error_setg(errp, "Not supported");
}