From 759bf45d81a892c359fa1a3848c36dcd74b6a42b Mon Sep 17 00:00:00 2001 From: Marcel Apfelbaum Date: Tue, 6 Jan 2015 15:29:13 +0200 Subject: [PATCH] hw/machine: added machine_usb wrapper Following QOM convention, object properties should not be accessed directly. Signed-off-by: Marcel Apfelbaum Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Alexander Graf --- hw/core/machine.c | 5 +++++ include/hw/boards.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index a0ae5f94ce..fbd91be575 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -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, diff --git a/include/hw/boards.h b/include/hw/boards.h index e0a67903ef..3ddc449bb6 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -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 -- 2.11.0