"incoming-defer", /* 200 */
"virtio-gpu",
+ "virtio-gpu.virgl",
);
{ "vgamem_mb", QEMU_CAPS_QXL_VGA_VGAMEM },
};
+static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioGpu[] = {
+ { "virgl", QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL },
+};
+
struct virQEMUCapsObjectTypeProps {
const char *type;
struct virQEMUCapsStringFlags *props;
ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl) },
{ "qxl-vga", virQEMUCapsObjectPropsQxlVga,
ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxlVga) },
+ { "virtio-gpu-pci", virQEMUCapsObjectPropsVirtioGpu,
+ ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu) },
};
/* 200 */
QEMU_CAPS_INCOMING_DEFER, /* -incoming defer and migrate_incoming */
QEMU_CAPS_DEVICE_VIRTIO_GPU, /* -device virtio-gpu-* & virtio-vga */
+ QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL, /* -device virtio-gpu-*.virgl */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias);
- if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
+ if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) {
+ if (video->accel && video->accel->accel3d) {
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("virtio-gpu 3d acceleration is not supported"));
+ goto error;
+ }
+
+ virBufferAsprintf(&buf, ",virgl=%s",
+ virTristateSwitchTypeToString(video->accel->accel3d));
+ }
+ } else if (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
if (video->vram > (UINT_MAX / 1024)) {
virReportError(VIR_ERR_OVERFLOW,
_("value for 'vram' must be less than '%u'"),
"id": "libvirt-30"
}
+{
+ "id": "libvirt-31",
+ "error": {
+ "class": "DeviceNotFound",
+ "desc": "Device 'virtio-gpu-pci' not found"
+ }
+}
+
{
"return": [
{
"name": "none"
}
],
- "id": "libvirt-31"
+ "id": "libvirt-32"
}
{
"name": "Opteron_G4"
}
],
- "id": "libvirt-32"
+ "id": "libvirt-33"
}
{
"enabled": false,
"present": true
},
- "id": "libvirt-33"
+ "id": "libvirt-34"
}
{
- "id": "libvirt-34",
+ "id": "libvirt-35",
"error": {
"class": "CommandNotFound",
"desc": "The command query-tpm-models has not been found"
}
{
- "id": "libvirt-35",
+ "id": "libvirt-36",
"error": {
"class": "CommandNotFound",
"desc": "The command query-tpm-types has not been found"
}
{
- "id": "libvirt-36",
+ "id": "libvirt-37",
"error": {
"class": "CommandNotFound",
"desc": "The command query-command-line-options has not been found"
"state": false
}
],
- "id": "libvirt-37"
+ "id": "libvirt-38"
}
"id": "libvirt-31"
}
+{
+ "id": "libvirt-32",
+ "error": {
+ "class": "DeviceNotFound",
+ "desc": "Device 'virtio-gpu-pci' not found"
+ }
+}
+
{
"return": [
{
"name": "none"
}
],
- "id": "libvirt-32"
+ "id": "libvirt-33"
}
{
"name": "Opteron_G5"
}
],
- "id": "libvirt-33"
+ "id": "libvirt-34"
}
{
"enabled": false,
"present": true
},
- "id": "libvirt-34"
+ "id": "libvirt-35"
}
{
- "id": "libvirt-35",
+ "id": "libvirt-36",
"error": {
"class": "CommandNotFound",
"desc": "The command query-tpm-models has not been found"
}
{
- "id": "libvirt-36",
+ "id": "libvirt-37",
"error": {
"class": "CommandNotFound",
"desc": "The command query-tpm-types has not been found"
}
{
- "id": "libvirt-37",
+ "id": "libvirt-38",
"error": {
"class": "CommandNotFound",
"desc": "The command query-command-line-options has not been found"
"state": false
}
],
- "id": "libvirt-38"
+ "id": "libvirt-39"
}
"id": "libvirt-31"
}
+{
+ "id": "libvirt-32",
+ "error": {
+ "class": "DeviceNotFound",
+ "desc": "Device 'virtio-gpu-pci' not found"
+ }
+}
+
{
"return": [
{
"name": "none"
}
],
- "id": "libvirt-32"
+ "id": "libvirt-33"
}
{
"name": "qemu64"
}
],
- "id": "libvirt-33"
+ "id": "libvirt-34"
}
{
"enabled": false,
"present": true
},
- "id": "libvirt-34"
+ "id": "libvirt-35"
}
{
- "id": "libvirt-35",
+ "id": "libvirt-36",
"error": {
"class": "CommandNotFound",
"desc": "The command query-tpm-models has not been found"
}
{
- "id": "libvirt-36",
+ "id": "libvirt-37",
"error": {
"class": "CommandNotFound",
"desc": "The command query-tpm-types has not been found"
}
{
- "id": "libvirt-37",
+ "id": "libvirt-38",
"error": {
"class": "CommandNotFound",
"desc": "The command query-command-line-options has not been found"
"state": false
}
],
- "id": "libvirt-38"
+ "id": "libvirt-39"
}
"id": "libvirt-31"
}
+{
+ "id": "libvirt-32",
+ "error": {
+ "class": "DeviceNotFound",
+ "desc": "Device 'virtio-gpu-pci' not found"
+ }
+}
+
{
"return": [
{
"cpu-max": 1
}
],
- "id": "libvirt-32"
+ "id": "libvirt-33"
}
{
"name": "qemu64"
}
],
- "id": "libvirt-33"
+ "id": "libvirt-34"
}
{
"enabled": false,
"present": true
},
- "id": "libvirt-34"
+ "id": "libvirt-35"
}
{
"return": [
],
- "id": "libvirt-35"
+ "id": "libvirt-36"
}
{
"return": [
],
- "id": "libvirt-36"
+ "id": "libvirt-37"
}
{
"option": "drive"
}
],
- "id": "libvirt-37"
+ "id": "libvirt-38"
}
{
"state": false
}
],
- "id": "libvirt-38"
+ "id": "libvirt-39"
}
"id": "libvirt-31"
}
+{
+ "id": "libvirt-32",
+ "error": {
+ "class": "DeviceNotFound",
+ "desc": "Device 'virtio-gpu-pci' not found"
+ }
+}
+
{
"return": [
{
"cpu-max": 1
}
],
- "id": "libvirt-32"
+ "id": "libvirt-33"
}
{
"name": "qemu64"
}
],
- "id": "libvirt-33"
+ "id": "libvirt-34"
}
{
"enabled": false,
"present": true
},
- "id": "libvirt-34"
+ "id": "libvirt-35"
}
{
"return": [
],
- "id": "libvirt-35"
+ "id": "libvirt-36"
}
{
"return": [
],
- "id": "libvirt-36"
+ "id": "libvirt-37"
}
{
"option": "drive"
}
],
- "id": "libvirt-37"
+ "id": "libvirt-38"
}
{
"state": false
}
],
- "id": "libvirt-38"
+ "id": "libvirt-39"
}
"id": "libvirt-31"
}
+{
+ "id": "libvirt-32",
+ "error": {
+ "class": "DeviceNotFound",
+ "desc": "Device 'virtio-gpu-pci' not found"
+ }
+}
+
{
"return": [
{
"cpu-max": 1
}
],
- "id": "libvirt-32"
+ "id": "libvirt-33"
}
{
"name": "qemu64"
}
],
- "id": "libvirt-33"
+ "id": "libvirt-34"
}
{
"enabled": false,
"present": true
},
- "id": "libvirt-34"
+ "id": "libvirt-35"
}
{
"return": [
],
- "id": "libvirt-35"
+ "id": "libvirt-36"
}
{
"return": [
],
- "id": "libvirt-36"
+ "id": "libvirt-37"
}
{
"option": "drive"
}
],
- "id": "libvirt-37"
+ "id": "libvirt-38"
}
{
"state": false
}
],
- "id": "libvirt-38"
+ "id": "libvirt-39"
}
"id": "libvirt-31"
}
+{
+ "id": "libvirt-32",
+ "error": {
+ "class": "DeviceNotFound",
+ "desc": "Device 'virtio-gpu-pci' not found"
+ }
+}
+
{
"return": [
{
"cpu-max": 255
}
],
- "id": "libvirt-32"
+ "id": "libvirt-33"
}
{
"name": "qemu64"
}
],
- "id": "libvirt-33"
+ "id": "libvirt-34"
}
{
"enabled": false,
"present": true
},
- "id": "libvirt-34"
+ "id": "libvirt-35"
}
{
"return": [
"tpm-tis"
],
- "id": "libvirt-35"
+ "id": "libvirt-36"
}
{
"return": [
"passthrough"
],
- "id": "libvirt-36"
+ "id": "libvirt-37"
}
{
"option": "drive"
}
],
- "id": "libvirt-37"
+ "id": "libvirt-38"
}
{
"capability": "zero-blocks"
}
],
- "id": "libvirt-38"
+ "id": "libvirt-39"
}
"id": "libvirt-31"
}
+{
+ "return": [
+ {
+ "name": "any_layout",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "notify_on_empty",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "event_idx",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "indirect_desc",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "max_outputs",
+ "type": "uint32"
+ },
+ {
+ "name": "virtio-backend",
+ "type": "child<virtio-gpu-device>"
+ },
+ {
+ "name": "command_serr_enable",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "multifunction",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "rombar",
+ "type": "uint32"
+ },
+ {
+ "name": "romfile",
+ "type": "str"
+ },
+ {
+ "name": "addr",
+ "description": "Slot and optional function number, example: 06.0 or 06",
+ "type": "int32"
+ },
+ {
+ "name": "disable-modern",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "disable-legacy",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "virtio-pci-bus-master-bug-migration",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "vectors",
+ "type": "uint32"
+ },
+ {
+ "name": "ioeventfd",
+ "description": "on/off",
+ "type": "bool"
+ }
+ ],
+ "id": "libvirt-32"
+}
+
{
"return": [
{
"cpu-max": 255
}
],
- "id": "libvirt-32"
+ "id": "libvirt-33"
}
{
"name": "qemu64"
}
],
- "id": "libvirt-33"
+ "id": "libvirt-34"
}
{
"enabled": false,
"present": true
},
- "id": "libvirt-34"
+ "id": "libvirt-35"
}
{
"return": [
"tpm-tis"
],
- "id": "libvirt-35"
+ "id": "libvirt-36"
}
{
"return": [
"passthrough"
],
- "id": "libvirt-36"
+ "id": "libvirt-37"
}
{
"option": "drive"
}
],
- "id": "libvirt-37"
+ "id": "libvirt-38"
}
{
"capability": "events"
}
],
- "id": "libvirt-38"
+ "id": "libvirt-39"
}
<flag name='virtio-net'/>
<flag name='incoming-defer'/>
<flag name='virtio-gpu'/>
+ <flag name='virtio-gpu.virgl'/>
</qemuCaps>
"id": "libvirt-31"
}
+{
+ "return": [
+ {
+ "name": "any_layout",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "notify_on_empty",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "event_idx",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "indirect_desc",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "virgl",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "max_outputs",
+ "type": "uint32"
+ },
+ {
+ "name": "virtio-backend",
+ "type": "child<virtio-gpu-device>"
+ },
+ {
+ "name": "command_serr_enable",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "multifunction",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "rombar",
+ "type": "uint32"
+ },
+ {
+ "name": "romfile",
+ "type": "str"
+ },
+ {
+ "name": "addr",
+ "description": "Slot and optional function number, example: 06.0 or 06",
+ "type": "int32"
+ },
+ {
+ "name": "disable-modern",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "disable-legacy",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "virtio-pci-bus-master-bug-migration",
+ "description": "on/off",
+ "type": "bool"
+ },
+ {
+ "name": "vectors",
+ "type": "uint32"
+ },
+ {
+ "name": "ioeventfd",
+ "description": "on/off",
+ "type": "bool"
+ }
+ ],
+ "id": "libvirt-32"
+}
+
{
"return": [
{
"cpu-max": 255
}
],
- "id": "libvirt-32"
+ "id": "libvirt-33"
}
{
"name": "qemu64"
}
],
- "id": "libvirt-33"
+ "id": "libvirt-34"
}
{
"enabled": false,
"present": true
},
- "id": "libvirt-34"
+ "id": "libvirt-35"
}
{
"return": [
"tpm-tis"
],
- "id": "libvirt-35"
+ "id": "libvirt-36"
}
{
"return": [
"passthrough"
],
- "id": "libvirt-36"
+ "id": "libvirt-37"
}
{
"option": "drive"
}
],
- "id": "libvirt-37"
+ "id": "libvirt-38"
}
{
"capability": "events"
}
],
- "id": "libvirt-38"
+ "id": "libvirt-39"
}
--- /dev/null
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-m 1024 \
+-smp 1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait \
+-no-acpi \
+-boot c \
+-usb \
+-drive file=/var/lib/libvirt/images/QEMUGuest1,if=none,id=drive-ide0-0-0,\
+format=qcow2,cache=none \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-device virtio-vga,id=video0,virgl=on,bus=pci.0,addr=0x2 \
+-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 unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</currentMemory>
+ <vcpu placement='static'>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='file' device='disk'>
+ <driver name='qemu' type='qcow2' cache='none'/>
+ <source file='/var/lib/libvirt/images/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <video>
+ <model type='virtio' heads='1'>
+ <acceleration accel3d='yes'/>
+ </model>
+ </video>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
DO_TEST("video-virtio-gpu-device",
QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIRTIO_GPU,
QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
+ DO_TEST("video-virtio-gpu-virgl",
+ QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIRTIO_GPU,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU_VIRGL,
+ QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
DO_TEST_PARSE_ERROR("video-invalid", NONE);
DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIRTIO_RNG,
DO_TEST("net-udp");
DO_TEST("video-virtio-gpu-device");
+ DO_TEST("video-virtio-gpu-virgl");
qemuTestDriverFree(&driver);