[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 1/2] Fix vga_interface_type for command '-device
From: |
Mark Wu |
Subject: |
[Qemu-devel] [PATCH v2 1/2] Fix vga_interface_type for command '-device VGA' |
Date: |
Fri, 7 Mar 2014 17:37:24 +0800 |
Some machine (like ppc) initialization code determines if it has
grahicis according to vga_interface_type. In the original code,
vga_interface_type is evaluated to VGA_NONE even if a vga is added
by '-device VGA'. It causes the machine not aware of the graphics
device configured. This patch adds a new vga device type to indicate
that it has a vga device, which will be initliazed in qom devices
initialization.
Signed-off-by: Mark Wu <address@hidden>
---
include/sysemu/sysemu.h | 2 +-
vl.c | 42 ++++++++++++++++++++++--------------------
2 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index b90df9a..c01304d 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -104,7 +104,7 @@ extern int autostart;
typedef enum {
VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL,
- VGA_TCX, VGA_CG3,
+ VGA_TCX, VGA_CG3, VGA_DEVICE
} VGAInterfaceType;
extern int vga_interface_type;
diff --git a/vl.c b/vl.c
index 685a7a9..d9afff4 100644
--- a/vl.c
+++ b/vl.c
@@ -213,6 +213,7 @@ uint32_t xen_domid;
enum xen_mode xen_mode = XEN_EMULATE;
static int tcg_tb_size;
+static int no_defaults = 0;
static int default_serial = 1;
static int default_parallel = 1;
static int default_virtcon = 1;
@@ -2041,7 +2042,7 @@ static void select_vgahw (const char *p)
{
const char *opts;
- vga_interface_type = VGA_NONE;
+ assert(vga_interface_type == VGA_NONE);
if (strstart(p, "std", &opts)) {
if (vga_available()) {
vga_interface_type = VGA_STD;
@@ -2825,7 +2826,7 @@ int main(int argc, char **argv, char **envp)
const char *loadvm = NULL;
QEMUMachine *machine;
const char *cpu_model;
- const char *vga_model = "none";
+ const char *vga_model = NULL;
const char *qtest_chrdev = NULL;
const char *qtest_log = NULL;
const char *pid_file = NULL;
@@ -3682,16 +3683,7 @@ int main(int argc, char **argv, char **envp)
runstate_set(RUN_STATE_INMIGRATE);
break;
case QEMU_OPTION_nodefaults:
- default_serial = 0;
- default_parallel = 0;
- default_virtcon = 0;
- default_sclp = 0;
- default_monitor = 0;
- default_net = 0;
- default_floppy = 0;
- default_cdrom = 0;
- default_sdcard = 0;
- default_vga = 0;
+ no_defaults = 1;
break;
case QEMU_OPTION_xen_domid:
if (!(xen_available())) {
@@ -3918,27 +3910,35 @@ int main(int argc, char **argv, char **envp)
qemu_opts_foreach(qemu_find_opts("device"), default_driver_check, NULL, 0);
qemu_opts_foreach(qemu_find_opts("global"), default_driver_check, NULL, 0);
- if (machine->no_serial) {
+ if (!vga_model && !default_vga) {
+ vga_interface_type = VGA_DEVICE;
+ }
+ if (no_defaults || machine->no_serial) {
default_serial = 0;
}
- if (machine->no_parallel) {
+ if (no_defaults || machine->no_parallel) {
default_parallel = 0;
}
- if (!machine->use_virtcon) {
+ if (no_defaults || !machine->use_virtcon) {
default_virtcon = 0;
}
- if (!machine->use_sclp) {
+ if (no_defaults || !machine->use_sclp) {
default_sclp = 0;
}
- if (machine->no_floppy) {
+ if (no_defaults || machine->no_floppy) {
default_floppy = 0;
}
- if (machine->no_cdrom) {
+ if (no_defaults || machine->no_cdrom) {
default_cdrom = 0;
}
- if (machine->no_sdcard) {
+ if (no_defaults || machine->no_sdcard) {
default_sdcard = 0;
}
+ if (no_defaults) {
+ default_monitor = 0;
+ default_net = 0;
+ default_vga = 0;
+ }
if (is_daemonized()) {
/* According to documentation and historically, -nographic redirects
@@ -4243,7 +4243,9 @@ int main(int argc, char **argv, char **envp)
vga_model = "std";
}
}
- select_vgahw(vga_model);
+ if (vga_model) {
+ select_vgahw(vga_model);
+ }
if (watchdog) {
i = select_watchdog(watchdog);
--
1.8.4.2
- [Qemu-devel] [PATCH v2 1/2] Fix vga_interface_type for command '-device VGA',
Mark Wu <=
- [Qemu-devel] [PATCH v2 2/2] Fix return value of vga initlization on ppc, Mark Wu, 2014/03/07
- Re: [Qemu-devel] [PATCH v2 2/2] Fix return value of vga initlization on ppc, Paolo Bonzini, 2014/03/07
- Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 2/2] Fix return value of vga initlization on ppc, Alexey Kardashevskiy, 2014/03/08
- Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 2/2] Fix return value of vga initlization on ppc, Paolo Bonzini, 2014/03/09
- Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 2/2] Fix return value of vga initlization on ppc, Alexey Kardashevskiy, 2014/03/10
- Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 2/2] Fix return value of vga initlization on ppc, Paolo Bonzini, 2014/03/10
- Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 2/2] Fix return value of vga initlization on ppc, Alexey Kardashevskiy, 2014/03/10
- Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 2/2] Fix return value of vga initlization on ppc, Paolo Bonzini, 2014/03/10
- Re: [Qemu-devel] [PATCH v2 2/2] Fix return value of vga initlization on ppc, Mark Wu, 2014/03/10