Skip to content

QEMU should warn if the user passes a '-vga something' option and we ignore it

Some of QEMU's machine types handle the -vga option and create a device based on it. Some machine types simply ignore the option and don't create any default VGA devices. It would be nice if we printed a warning to the user when they passed a vga option and we didn't create a vga device.

Implementing this is a bit tricky because the handling of the device creation is not done in a single central place. First the softmmu/vl.c code sets vga_interface_type (as a result of parsing -vga options and/or selecting a default vga device type). Then when the machine is being created, vga_interface_type is handled, either in:

  • pci_vga_init()
  • isa_vga_init()
  • for some machines, in a custom way (eg sparc sun4m may create a cg3 or tcx)

We could probably do something like:

  • whenever code looks at vga_interface_type and creates a device, it sets a flag vga_interface_created
  • in softmmu/vl.c, in qemu_machine_creation_done() we can warn if the user asked for a vga device but vga_interface_created is still false (this goes with the existing "orphan drives" and "non-connected nic" user-option checks)

I haven't looked at exactly what the condition is that distinguishes "user asked for a vga device" (warning needed) from "we defaulted to creating a vga device" (no warning needed), but it probably isn't too complicated.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information