[libvirt] [PATCH v3 3/6] QXL: fix setting ram and vram values for QEMU QXL device

Peter Krempa pkrempa at redhat.com
Mon Nov 24 13:28:27 UTC 2014


On 11/20/14 20:21, Pavel Hrdina wrote:
> QEMU has two different type of QXL display device. The first "qxl-vga"
> is for primary video device and second "qxl" is for secondary video
> device.
> 
> There are also two different ways how to specify those devices on qemu
> command line, the first one and obsolete is using "-vga" option and the
> current new one is using "-device" option. The "-vga" could be used only
> to setup primary video device, so the "-vga qxl" equal to
> "-device qxl-vga". Unfortunately the "-vga qxl" doesn't support setting
> additional parameters for the device and "-global" option must be used
> for this purpose. It's mandatory to use "-global qxl-vga...." to set the
> parameters of primary video device previously defined with "-vga qxl".
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098
> 
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
>  src/qemu/qemu_command.c                                             | 4 ++--
>  tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args | 2 +-
>  tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args        | 4 ++--
>  tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args             | 4 ++--
>  tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args              | 2 +-
>  tests/qemuxml2argvdata/qemuxml2argv-q35.args                        | 2 +-
>  6 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 0392f11..0c77b57 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -9328,11 +9328,11 @@ qemuBuildCommandLine(virConnectPtr conn,
>  
>                  virCommandAddArgList(cmd, "-vga", vgastr, NULL);
>  
> +                const char *dev = qemuDeviceVideoTypeToString(primaryVideoType);

Here I'd add a comment on why is the "qemuDeviceVideoType" (that is used
primarily for the --device way of specifying the video device) used
instead of "qemuVideoType" (used for -vga). Perhaps you could link to
the relevant qemu document for this case.

> +
>                  if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL &&
>                      (def->videos[0]->vram || def->videos[0]->ram) &&
>                      virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
> -                    const char *dev = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA)
> -                                       ? "qxl-vga" : "qxl");
>                      unsigned int ram = def->videos[0]->ram;
>                      unsigned int vram = def->videos[0]->vram;
>  

ACK with the comment added.

Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141124/ca29d60c/attachment-0001.sig>


More information about the libvir-list mailing list