* [Qemu-devel] [PATCH 1.1] vga: disable default VGA if appropriate -device is used
@ 2012-05-10 7:39 Paolo Bonzini
2012-05-12 9:54 ` Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2012-05-10 7:39 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel
This is a partial revert of commits a369da5 (vga: improve VGA logic,
committed 2012-01-22) and c5bd4f3 (vga: fix -nodefaults -device VGA,
2012-01-24) which broke command-line option parsing in different ways.
Since commit a369da5 it has become impossible to specify a VGA device
entirely with QemuOpts-enabled options, i.e. without needing an explicit
"-vga none".
In addition, until commit c5bd4f3 -nodefaults would not disable the device
you specified with the legacy "-vga" option, independent of the order.
Since commit c5bd4f3 QEMU -nodefaults will override a previous -vga
option.
I did not reintroduce machine->no_vga. Boards can simply ignore the
vga_interface_type variable, and most will indeed do so.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
vl.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/vl.c b/vl.c
index 5e0080b..c4f87e8 100644
--- a/vl.c
+++ b/vl.c
@@ -273,6 +273,7 @@ static int default_monitor = 1;
static int default_floppy = 1;
static int default_cdrom = 1;
static int default_sdcard = 1;
+static int default_vga = 1;
static struct {
const char *driver;
@@ -288,6 +289,12 @@ static struct {
{ .driver = "virtio-serial-pci", .flag = &default_virtcon },
{ .driver = "virtio-serial-s390", .flag = &default_virtcon },
{ .driver = "virtio-serial", .flag = &default_virtcon },
+ { .driver = "VGA", .flag = &default_vga },
+ { .driver = "isa-vga", .flag = &default_vga },
+ { .driver = "cirrus-vga", .flag = &default_vga },
+ { .driver = "isa-cirrus-vga", .flag = &default_vga },
+ { .driver = "vmware-svga", .flag = &default_vga },
+ { .driver = "qxl-vga", .flag = &default_vga },
};
static void res_free(void)
@@ -2277,7 +2284,7 @@ int main(int argc, char **argv, char **envp)
const char *loadvm = NULL;
QEMUMachine *machine;
const char *cpu_model;
- const char *vga_model = NULL;
+ const char *vga_model = "none";
const char *pid_file = NULL;
const char *incoming = NULL;
#ifdef CONFIG_VNC
@@ -2709,6 +2716,7 @@ int main(int argc, char **argv, char **envp)
break;
case QEMU_OPTION_vga:
vga_model = optarg;
+ default_vga = 0;
break;
case QEMU_OPTION_g:
{
@@ -3118,7 +3126,7 @@ int main(int argc, char **argv, char **envp)
default_floppy = 0;
default_cdrom = 0;
default_sdcard = 0;
- vga_model = "none";
+ default_vga = 0;
break;
case QEMU_OPTION_xen_domid:
if (!(xen_available())) {
@@ -3488,14 +3496,11 @@ int main(int argc, char **argv, char **envp)
if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0)
exit(1);
- /* must be after qdev registration but before machine init */
- if (vga_model) {
- select_vgahw(vga_model);
- } else if (cirrus_vga_available()) {
- select_vgahw("cirrus");
- } else {
- select_vgahw("none");
+ /* If no default VGA is requested, the default is "none". */
+ if (default_vga && cirrus_vga_available()) {
+ vga_model = "cirrus";
}
+ select_vgahw(vga_model);
if (qemu_opts_foreach(qemu_find_opts("device"), device_help_func, NULL, 0) != 0)
exit(0);
--
1.7.10.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH 1.1] vga: disable default VGA if appropriate -device is used
2012-05-10 7:39 [Qemu-devel] [PATCH 1.1] vga: disable default VGA if appropriate -device is used Paolo Bonzini
@ 2012-05-12 9:54 ` Blue Swirl
0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2012-05-12 9:54 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
Thanks, applied.
On Thu, May 10, 2012 at 7:39 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> This is a partial revert of commits a369da5 (vga: improve VGA logic,
> committed 2012-01-22) and c5bd4f3 (vga: fix -nodefaults -device VGA,
> 2012-01-24) which broke command-line option parsing in different ways.
>
> Since commit a369da5 it has become impossible to specify a VGA device
> entirely with QemuOpts-enabled options, i.e. without needing an explicit
> "-vga none".
>
> In addition, until commit c5bd4f3 -nodefaults would not disable the device
> you specified with the legacy "-vga" option, independent of the order.
> Since commit c5bd4f3 QEMU -nodefaults will override a previous -vga
> option.
>
> I did not reintroduce machine->no_vga. Boards can simply ignore the
> vga_interface_type variable, and most will indeed do so.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> vl.c | 23 ++++++++++++++---------
> 1 file changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 5e0080b..c4f87e8 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -273,6 +273,7 @@ static int default_monitor = 1;
> static int default_floppy = 1;
> static int default_cdrom = 1;
> static int default_sdcard = 1;
> +static int default_vga = 1;
>
> static struct {
> const char *driver;
> @@ -288,6 +289,12 @@ static struct {
> { .driver = "virtio-serial-pci", .flag = &default_virtcon },
> { .driver = "virtio-serial-s390", .flag = &default_virtcon },
> { .driver = "virtio-serial", .flag = &default_virtcon },
> + { .driver = "VGA", .flag = &default_vga },
> + { .driver = "isa-vga", .flag = &default_vga },
> + { .driver = "cirrus-vga", .flag = &default_vga },
> + { .driver = "isa-cirrus-vga", .flag = &default_vga },
> + { .driver = "vmware-svga", .flag = &default_vga },
> + { .driver = "qxl-vga", .flag = &default_vga },
> };
>
> static void res_free(void)
> @@ -2277,7 +2284,7 @@ int main(int argc, char **argv, char **envp)
> const char *loadvm = NULL;
> QEMUMachine *machine;
> const char *cpu_model;
> - const char *vga_model = NULL;
> + const char *vga_model = "none";
> const char *pid_file = NULL;
> const char *incoming = NULL;
> #ifdef CONFIG_VNC
> @@ -2709,6 +2716,7 @@ int main(int argc, char **argv, char **envp)
> break;
> case QEMU_OPTION_vga:
> vga_model = optarg;
> + default_vga = 0;
> break;
> case QEMU_OPTION_g:
> {
> @@ -3118,7 +3126,7 @@ int main(int argc, char **argv, char **envp)
> default_floppy = 0;
> default_cdrom = 0;
> default_sdcard = 0;
> - vga_model = "none";
> + default_vga = 0;
> break;
> case QEMU_OPTION_xen_domid:
> if (!(xen_available())) {
> @@ -3488,14 +3496,11 @@ int main(int argc, char **argv, char **envp)
> if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0)
> exit(1);
>
> - /* must be after qdev registration but before machine init */
> - if (vga_model) {
> - select_vgahw(vga_model);
> - } else if (cirrus_vga_available()) {
> - select_vgahw("cirrus");
> - } else {
> - select_vgahw("none");
> + /* If no default VGA is requested, the default is "none". */
> + if (default_vga && cirrus_vga_available()) {
> + vga_model = "cirrus";
> }
> + select_vgahw(vga_model);
>
> if (qemu_opts_foreach(qemu_find_opts("device"), device_help_func, NULL, 0) != 0)
> exit(0);
> --
> 1.7.10.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-12 9:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-10 7:39 [Qemu-devel] [PATCH 1.1] vga: disable default VGA if appropriate -device is used Paolo Bonzini
2012-05-12 9:54 ` Blue Swirl
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).