From f8b6f8edac926bb979bd2b1d21d896c219b522c2 Mon Sep 17 00:00:00 2001 From: Marcel Apfelbaum Date: Tue, 6 Jan 2015 15:29:12 +0200 Subject: hw/ppc: modified the condition for usb controllers to be created for some ppc machines Some ppc machines create a default usb controller based on a 'machine condition'. Until now the logic was: create the usb controller if: - the usb option was supplied in cli and value is true or - the usb option was absent and both set_defaults and the machine condition were true. Modified the logic to: Create the usb controller if: - the machine condition is true and defaults are enabled or - the usb option is supplied and true. The main for this is to simplify the usb_enabled method. Signed-off-by: Marcel Apfelbaum Reviewed-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Reviewed-by: Alexander Graf Message-id: 1420550957-22337-2-git-send-email-marcel@redhat.com Signed-off-by: Peter Maydell --- vl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index bea9656..415535f 100644 --- a/vl.c +++ b/vl.c @@ -997,10 +997,15 @@ static int parse_name(QemuOpts *opts, void *opaque) return 0; } +bool defaults_enabled(void) +{ + return has_defaults; +} + bool usb_enabled(bool default_usb) { return qemu_opt_get_bool(qemu_get_machine_opts(), "usb", - has_defaults && default_usb); + default_usb); } #ifndef _WIN32 -- cgit v1.1