From: Mark Wu <wudxw@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: nikunj@linux.vnet.ibm.com, agraf@suse.de,
Mark Wu <wudxw@linux.vnet.ibm.com>,
aliguori@amazon.com, pbonzini@redhat.com, afaerber@suse.de
Subject: [Qemu-devel] [PATCH v3 2/2] Fix return value of vga initlization on ppc
Date: Mon, 10 Mar 2014 22:37:41 +0800 [thread overview]
Message-ID: <1394462261-25581-2-git-send-email-wudxw@linux.vnet.ibm.com> (raw)
In-Reply-To: <1394462261-25581-1-git-send-email-wudxw@linux.vnet.ibm.com>
Before spapr_vga_init will returned false if the vga is specified by
the command '-device VGA' because vga_interface_type was evaluated to
VGA_NONE. With the change in previous patch of this series,
spapr_vga_init should return true if it's told that the vga will be
initialized in flow of the generic devices initialization.
To keep '-nodefaults' have the semantics of bare minimum, it adds a
check of 'has_defaults' in usb_enabled() to avoid that a USB controller
is added by '-nodefautls, -device VGA' implicitly.
This patch also makes two cleanups:
1. skip initialization for VGA_NONE
2. remove the useless 'break'
Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
---
hw/ppc/spapr.c | 4 +++-
vl.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index bf46c38..5c9a154 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -781,13 +781,15 @@ static int spapr_vga_init(PCIBus *pci_bus)
{
switch (vga_interface_type) {
case VGA_NONE:
+ return false;
+ case VGA_DEVICE:
+ return true;
case VGA_STD:
return pci_vga_init(pci_bus) != NULL;
default:
fprintf(stderr, "This vga model is not supported,"
"currently it only supports -vga std\n");
exit(0);
- break;
}
}
diff --git a/vl.c b/vl.c
index f8f7c00..e9d8baf 100644
--- a/vl.c
+++ b/vl.c
@@ -932,7 +932,8 @@ static int parse_sandbox(QemuOpts *opts, void *opaque)
bool usb_enabled(bool default_usb)
{
- return qemu_opt_get_bool(qemu_get_machine_opts(), "usb", default_usb);
+ return qemu_opt_get_bool(qemu_get_machine_opts(), "usb",
+ has_defaults && default_usb);
}
#ifndef _WIN32
--
1.8.4.2
next prev parent reply other threads:[~2014-03-10 14:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-10 14:37 [Qemu-devel] [PATCH v3 1/2] Fix vga_interface_type for command '-device VGA' Mark Wu
2014-03-10 14:37 ` Mark Wu [this message]
2014-03-10 14:52 ` [Qemu-devel] [PATCH v3 2/2] Fix return value of vga initlization on ppc Paolo Bonzini
2014-03-11 9:52 ` Mark Wu
2014-03-11 9:53 ` Paolo Bonzini
2014-03-13 16:45 ` Andreas Färber
2014-03-10 14:52 ` [Qemu-devel] [PATCH v3 1/2] Fix vga_interface_type for command '-device VGA' Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1394462261-25581-2-git-send-email-wudxw@linux.vnet.ibm.com \
--to=wudxw@linux.vnet.ibm.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aliguori@amazon.com \
--cc=nikunj@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).