OSDN Git Service

hw/machine: added machine_usb wrapper
authorMarcel Apfelbaum <marcel@redhat.com>
Tue, 6 Jan 2015 13:29:13 +0000 (15:29 +0200)
committerAlexander Graf <agraf@suse.de>
Wed, 7 Jan 2015 15:16:28 +0000 (16:16 +0100)
Following QOM convention, object properties should
not be accessed directly.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/core/machine.c
include/hw/boards.h

index a0ae5f9..fbd91be 100644 (file)
@@ -398,6 +398,11 @@ static void machine_finalize(Object *obj)
     g_free(ms->firmware);
 }
 
+bool machine_usb(MachineState *machine)
+{
+    return machine->usb;
+}
+
 static const TypeInfo machine_info = {
     .name = TYPE_MACHINE,
     .parent = TYPE_OBJECT,
index e0a6790..3ddc449 100644 (file)
@@ -65,6 +65,8 @@ int qemu_register_machine(QEMUMachine *m);
 MachineClass *find_default_machine(void);
 extern MachineState *current_machine;
 
+bool machine_usb(MachineState *machine);
+
 /**
  * MachineClass:
  * @qemu_machine: #QEMUMachine