Skip to contentSkip to conversation

-vga switch

Qemu-devel In review C.W. Betts 6 participants 8 messages Apr 13, 2008 – May 5, 2008

lore
Share & tools
lore

C.W. Betts

author
#0 lore raw

I'm just throwing this out here to see if anyone else is interested in this
idea: There seems to be different arguments to set up a display adaptor for a virtual machine. Why not set it up so that you can have a central way of doing it, such as a -vga argument. For instance, -vga vmware would use the vmware VGA adaptor, and -vga standard would use the standard VGA adaptor, and so on.

#1 lore raw
Quoted 1 line

I'm just throwing this out here to see if anyone else is interested in this idea: There seems to be different arguments to set up a display adaptor for a virtual machine. Why not set it up so that you can have a central way of doing it, such as a -vga argument. For instance, -vga vmware would use the vmware VGA adaptor, and -vga standard would use the standard VGA adaptor, and so on.

You mean something like this?

vl.c Mon Apr 14 20:19:24 2008 renamed from vl.c.orig Mon Apr 14 19:20:56 2008 +1 -0
@@ -7835,6 +7835,7 @@ enum {
    QEMU_OPTION_old_param,
    QEMU_OPTION_clock,
    QEMU_OPTION_startdate,
+    QEMU_OPTION_vga,

};

typedef struct QEMUOption {
@@ -7946,6 +7947,7 @@ const QEMUOption qemu_options[] = { #endif
{ "clock", HAS_ARG, QEMU_OPTION_clock },
{ "startdate", HAS_ARG, QEMU_OPTION_startdate },
+ { "vga", HAS_ARG, QEMU_OPTION_vga },

    { NULL },
};

@@ -8793,6 +8795,21 @@ int main(int argc, char **argv)

                        }
                        rtc_date_offset = time(NULL) - rtc_start_date;
                    }

+ }
+ break;
+ case QEMU_OPTION_vga:
+ if (!strcmp(optarg, "cirrus")) {
+ cirrus_vga_enabled = 1;
+ vmsvga_enabled = 0;
+ } else if (!strcmp(optarg, "std")) {
+ cirrus_vga_enabled = 0;
+ vmsvga_enabled = 0;
+ } else if (!strcmp(optarg, "vmware")) {
+ cirrus_vga_enabled = 0;
+ vmsvga_enabled = 1;
+ } else {
+ fprintf(stderr, "Supported vga cards: cirrus, std, vmware\n");

+                    exit(1);
                }
                break;
            }

- Sebastian

#2 lore raw

Hi,

Quoted 6 lines · Sebastian Herbszt
Quoted 3 lines

I'm just throwing this out here to see if anyone else is interested in this idea: There seems to be different arguments to set up a display adaptor for a virtual machine. Why not set it up so that you can have a central way of doing it, such as a -vga argument. For instance, -vga vmware would use the vmware VGA adaptor, and -vga standard would
use the standard VGA adaptor, and so on.

You mean something like this?

[snip]

Quoted 1 line

I would better name it -display, as not all computers have VGA-compatible cards.

Hervé

#3 lore raw

PATCH 1/1 Add -display option

Quoted 1 line

I would better name it -display, as not all computers have VGA-compatible cards.

vl.c Sun Apr 20 20:47:15 2008 renamed from vl.c.orig Tue Apr 15 20:07:18 2008 +1 -0
@@ -7852,6 +7852,7 @@
    QEMU_OPTION_old_param,
    QEMU_OPTION_clock,
    QEMU_OPTION_startdate,
+    QEMU_OPTION_display,

};

typedef struct QEMUOption {
@@ -7964,6 +7965,7 @@
#endif
{ "clock", HAS_ARG, QEMU_OPTION_clock }, { "startdate", HAS_ARG, QEMU_OPTION_startdate },
+ { "display", HAS_ARG, QEMU_OPTION_display },

    { NULL },
};

@@ -8816,6 +8818,26 @@

                        }
                        rtc_date_offset = time(NULL) - rtc_start_date;
                    }

+ }
+ break;
+ case QEMU_OPTION_display:
+ if (!strcmp(optarg, "cirrus")) {
+ cirrus_vga_enabled = 1;
+ vmsvga_enabled = 0;
+ } else if (!strcmp(optarg, "std")) {
+ cirrus_vga_enabled = 0;
+ vmsvga_enabled = 0;
+ } else if (!strcmp(optarg, "vmware")) {
+ cirrus_vga_enabled = 0;
+ vmsvga_enabled = 1;
+ } else if (!strcmp(optarg, "none")) {

+                    serial_devices[0] = "stdio";
+                    parallel_devices[0] = "null";
+                    monitor_device = "stdio";
+                    nographic = 1;
+                } else {
+                    fprintf(stderr, "Display devices available: cirrus, std, vmware, none\n");
+                    exit(1);
                }
                break;
            }

- Sebastian

#4 lore raw

Re: [Qemu-devel] [PATCH] Add -display option

Quoted 31 lines · Sebastian Herbszt
Quoted 1 line

I would better name it -display, as not all computers have VGA-compatible cards.

vl.c Sun Apr 20 20:47:15 2008 renamed from vl.c.orig Tue Apr 15 20:07:18 2008 +9 -0
@@ -7852,6 +7852,7 @@
    QEMU_OPTION_old_param,
    QEMU_OPTION_clock,
    QEMU_OPTION_startdate,
+    QEMU_OPTION_display,
 };
 
 typedef struct QEMUOption {
@@ -7964,6 +7965,7 @@
 #endif
    { "clock", HAS_ARG, QEMU_OPTION_clock },
    { "startdate", HAS_ARG, QEMU_OPTION_startdate },
+    { "display", HAS_ARG, QEMU_OPTION_display },
    { NULL },
 };
 
@@ -8816,6 +8818,26 @@
                        }
                        rtc_date_offset = time(NULL) - rtc_start_date;
                    }
+                }
+                break;
+            case QEMU_OPTION_display:
+                if (!strcmp(optarg, "cirrus")) {
+                    cirrus_vga_enabled = 1;
+                    vmsvga_enabled = 0;
+                } else if (!strcmp(optarg, "std")) {

vl.c Sun Apr 20 20:47:15 2008 line 8837

Quoted 10 lines
vl.c Sun Apr 20 20:47:15 2008 renamed from vl.c.orig Tue Apr 15 20:07:18 2008 +10 -0
+                    cirrus_vga_enabled = 0;
+                    vmsvga_enabled = 0;
+                } else if (!strcmp(optarg, "vmware")) {
+                    cirrus_vga_enabled = 0;
+                    vmsvga_enabled = 1;
+                } else if (!strcmp(optarg, "none")) {
+                    serial_devices[0] = "stdio";
+                    parallel_devices[0] = "null";
+                    monitor_device = "stdio";
+                    nographic = 1;

I don't think -display none should be a synonym for -nographic. It should just suppress the creation of a VGA device. If a platform doesn't support that, it should raise an error.

Regards,

Anthony Liguori

Quoted 13 lines
vl.c Sun Apr 20 20:47:15 2008 renamed from vl.c.orig Tue Apr 15 20:07:18 2008 +3 -0
+                } else {
+                    fprintf(stderr, "Display devices available: 
 cirrus, std, vmware, none\n");
+                    exit(1);
                }
                break;
            }

- Sebastian

#5 lore raw

Re: [Qemu-devel] [PATCH] Add -display option

Quoted 21 lines · Anthony Liguori
Quoted 9 lines · Sebastian Herbszt
Quoted 2 lines

I would better name it -display, as not all computers have VGA-compatible cards.

(quoted diff) +6 -0
+                break;
+            case QEMU_OPTION_display:
+                if (!strcmp(optarg, "cirrus")) {
+                    cirrus_vga_enabled = 1;
+                    vmsvga_enabled = 0;
+                } else if (!strcmp(optarg, "std")) {

Review

Quoted 10 lines
(quoted diff) +10 -0
+                    cirrus_vga_enabled = 0;
+                    vmsvga_enabled = 0;
+                } else if (!strcmp(optarg, "vmware")) {
+                    cirrus_vga_enabled = 0;
+                    vmsvga_enabled = 1;
+                } else if (!strcmp(optarg, "none")) {
+                    serial_devices[0] = "stdio";
+                    parallel_devices[0] = "null";
+                    monitor_device = "stdio";
+                    nographic = 1;
Quoted 3 lines

I don't think -display none should be a synonym for -nographic. It should just suppress the creation of a VGA device. If a platform doesn't support that, it should raise an error.

I agree - its rather unfortunate that -nographic changes the default settings for serial / parallel devices - it makes it troublesome to launch QEMU with a predictable config. Having 'none' merely supress the VGA device would be preferrable behaviour.

It is certainly nice from a libvirt point of view to have a generic flag -display like this.

Dan.

Signature · 4 lines
|: Red Hat, Engineering, Boston   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
#6 lore raw

[Qemu-devel] Re: [PATCH] Add -display option

From: "Daniel P. Berrange"

Quoted 21 lines · Anthony Liguori
Quoted 20 lines
Quoted 18 lines · Sebastian Herbszt
Quoted 1 line

I would better name it -display, as not all computers have VGA-compatible cards.

(quoted diff) +16 -0
+                break;
+            case QEMU_OPTION_display:
+                if (!strcmp(optarg, "cirrus")) {
+                    cirrus_vga_enabled = 1;
+                    vmsvga_enabled = 0;
+                } else if (!strcmp(optarg, "std")) {
+                    cirrus_vga_enabled = 0;
+                    vmsvga_enabled = 0;
+                } else if (!strcmp(optarg, "vmware")) {
+                    cirrus_vga_enabled = 0;
+                    vmsvga_enabled = 1;
+                } else if (!strcmp(optarg, "none")) {
+                    serial_devices[0] = "stdio";
+                    parallel_devices[0] = "null";
+                    monitor_device = "stdio";
+                    nographic = 1;
Quoted 5 lines
Quoted 1 line

I don't think -display none should be a synonym for -nographic. It should just suppress the creation of a VGA device. If a platform doesn't support that, it should raise an error.

I agree - its rather unfortunate that -nographic changes the default
settings for serial / parallel devices - it makes it troublesome to launch QEMU with a predictable config. Having 'none' merely supress the VGA device would be preferrable behaviour.

Since i did not find that functionality yet, what would be the correct implementation? Would adding an "int display_enabled = 1" in vl.c suffice? With "-display none" display_enabled would be set to 0. A platform not supporting it would then bail out with an error in its init (e.g. pc_init1 from hw/pc.c).

- Sebastian

#7 lore raw
In reply to Hervé Poussineau
Quoted 2 lines · Hervé Poussineau

I would better name it -display, as not all computers have VGA-compatible cards.

-display is pretty standard to specify the X display to connect to... How about -videoout or such?