/* Original Xen PVFB hardcoded to 4 MB */
return 4 * 1024;
+ case VIR_DOMAIN_VIDEO_TYPE_QXL:
+ /* QEMU use 64M as the minimal video video memory for qxl device */
+ return 64 * 1024;
+
default:
return 0;
}
}
if (strstr(str, "virtio-net-pci.tx="))
qemuCapsSet(flags, QEMU_CAPS_VIRTIO_TX_ALG);
+ if (strstr(str, "name \"qxl-vga\""))
+ qemuCapsSet(flags, QEMU_CAPS_DEVICE_QXL_VGA);
return 0;
}
QEMU_CAPS_CHARDEV_SPICEVMC = 56, /* newer -chardev spicevmc */
QEMU_CAPS_DEVICE_SPICEVMC = 57, /* older -device spicevmc*/
QEMU_CAPS_VIRTIO_TX_ALG = 58, /* -device virtio-net-pci,tx=string */
+ QEMU_CAPS_DEVICE_QXL_VGA = 59, /* Is the primary and vga campatible qxl device named qxl-vga? */
QEMU_CAPS_LAST, /* this must always be the last item */
};
virBufferVSprintf(&buf, "%s", model);
virBufferVSprintf(&buf, ",id=%s", video->info.alias);
+
+ if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
+ /* QEMU accepts bytes for vram_size. */
+ virBufferVSprintf(&buf, ",vram_size=%u", video->vram * 1024);
+ }
+
if (qemuBuildDeviceAddressStr(&buf, &video->info, qemuCaps) < 0)
goto error;
}
virCommandAddArgList(cmd, "-vga", vgastr, NULL);
+
+ if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
+ if (def->videos[0]->vram &&
+ qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
+ if (qemuCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA))
+ virCommandAddArgFormat(cmd, "-global qxl-vga.vram_size=%u",
+ def->videos[0]->vram * 1024);
+ else
+ virCommandAddArgFormat(cmd, "-global qxl.vram_size=%u",
+ def->videos[0]->vram * 1024);
+ }
+ }
}
} else {
QEMU_CAPS_DRIVE_AIO,
QEMU_CAPS_CCID_PASSTHRU,
QEMU_CAPS_CHARDEV_SPICEVMC,
+ QEMU_CAPS_DEVICE_QXL_VGA,
QEMU_CAPS_VIRTIO_TX_ALG);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
--- /dev/null
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nodefaults -monitor \
+unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda \
+/dev/HostVG/QEMUGuest1 -usb -spice port=5903,tls-port=5904,addr=127.0.0.1,\
+x509-dir=/etc/pki/libvirt-spice,tls-channel=main,plaintext-channel=inputs -vga \
+qxl -global qxl-vga.vram_size=33554432 -device qxl,id=video1,vram_size=67108864,bus=pci.0,addr=0x4 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219136</memory>
+ <currentMemory>219136</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <input type='mouse' bus='ps2'/>
+ <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1'>
+ <channel name='main' mode='secure'/>
+ <channel name='inputs' mode='insecure'/>
+ </graphics>
+ <video>
+ <model type='qxl' vram='32768' heads='1'/>
+ </video>
+ <video>
+ <model type='qxl' vram='65536' heads='1'/>
+ </video>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -hda \
/dev/HostVG/QEMUGuest1 -usb -spice port=5903,tls-port=5904,addr=127.0.0.1,\
x509-dir=/etc/pki/libvirt-spice,tls-channel=main,plaintext-channel=inputs -vga \
-qxl -device qxl,id=video1,bus=pci.0,addr=0x4 -device virtio-balloon-pci,\
-id=balloon0,bus=pci.0,addr=0x3
+qxl -global qxl.vram_size=18874368 -device qxl,id=video1,vram_size=33554432,bus=pci.0,addr=0x4 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
<channel name='inputs' mode='insecure'/>
</graphics>
<video>
- <model type='qxl' vram='65536' heads='1'/>
+ <model type='qxl' vram='18432' heads='1'/>
</video>
<video>
- <model type='qxl' vram='65536' heads='1'/>
+ <model type='qxl' vram='32768' heads='1'/>
</video>
<memballoon model='virtio'/>
</devices>
DO_TEST("graphics-spice", false,
QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL,
QEMU_CAPS_DEVICE, QEMU_CAPS_SPICE);
+ DO_TEST("graphics-spice-qxl-vga", false,
+ QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL,
+ QEMU_CAPS_DEVICE, QEMU_CAPS_SPICE,
+ QEMU_CAPS_DEVICE_QXL_VGA);
DO_TEST("input-usbmouse", false, NONE);
DO_TEST("input-usbtablet", false, NONE);
DO_TEST("graphics-sdl");
DO_TEST("graphics-sdl-fullscreen");
DO_TEST("graphics-spice");
+ DO_TEST("graphics-spice-qxl-vga");
DO_TEST("input-usbmouse");
DO_TEST("input-usbtablet");
DO_TEST("input-xen");