|
|
99cbc7 |
From 2d16cb96407ed22af46b892e3319f04ac61924ed Mon Sep 17 00:00:00 2001
|
|
|
99cbc7 |
Message-Id: <2d16cb96407ed22af46b892e3319f04ac61924ed@dist-git>
|
|
|
99cbc7 |
From: Erik Skultety <eskultet@redhat.com>
|
|
|
99cbc7 |
Date: Thu, 19 Jul 2018 15:04:02 +0200
|
|
|
99cbc7 |
Subject: [PATCH] conf: Introduce new <hostdev> attribute 'display'
|
|
|
99cbc7 |
MIME-Version: 1.0
|
|
|
99cbc7 |
Content-Type: text/plain; charset=UTF-8
|
|
|
99cbc7 |
Content-Transfer-Encoding: 8bit
|
|
|
99cbc7 |
|
|
|
99cbc7 |
QEMU 2.12 introduced a new type of display for mediated devices using
|
|
|
99cbc7 |
vfio-pci backend which allows a mediated device to be used as a VGA
|
|
|
99cbc7 |
compatible device as an alternative to an emulated video device. QEMU
|
|
|
99cbc7 |
exposes this feature via a vfio device property 'display' with supported
|
|
|
99cbc7 |
values 'on/off/auto' (libvirt will default to 'off').
|
|
|
99cbc7 |
|
|
|
99cbc7 |
This patch adds the necessary bits to domain config handling in order to
|
|
|
99cbc7 |
expose this feature. Since there's no convenient way for libvirt to come
|
|
|
99cbc7 |
up with usable defaults for the display setting, simply because libvirt
|
|
|
99cbc7 |
is not able to figure out which of the display implementations - dma-buf
|
|
|
99cbc7 |
which requires OpenGL support vs vfio regions which doesn't need OpenGL
|
|
|
99cbc7 |
(works with OpenGL enabled too) - the underlying mdev uses.
|
|
|
99cbc7 |
|
|
|
99cbc7 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
99cbc7 |
Signed-off-by: Erik Skultety <eskultet@redhat.com>
|
|
|
99cbc7 |
(cherry picked from commit d54e45b6edd7623e488a19e30bc4148a21fa8b03)
|
|
|
99cbc7 |
|
|
|
99cbc7 |
https://bugzilla.redhat.com/show_bug.cgi?id=1475770
|
|
|
99cbc7 |
Signed-off-by: Erik Skultety <eskultet@redhat.com>
|
|
|
99cbc7 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
99cbc7 |
---
|
|
|
99cbc7 |
docs/formatdomain.html.in | 20 +++-
|
|
|
99cbc7 |
docs/schemas/domaincommon.rng | 5 +
|
|
|
99cbc7 |
src/conf/domain_conf.c | 19 +++-
|
|
|
99cbc7 |
src/conf/domain_conf.h | 1 +
|
|
|
99cbc7 |
src/qemu/qemu_domain.c | 98 ++++++++++++++++++-
|
|
|
99cbc7 |
.../qemuxml2argvdata/hostdev-mdev-display.xml | 39 ++++++++
|
|
|
99cbc7 |
.../hostdev-mdev-display.xml | 47 +++++++++
|
|
|
99cbc7 |
tests/qemuxml2xmltest.c | 1 +
|
|
|
99cbc7 |
8 files changed, 222 insertions(+), 8 deletions(-)
|
|
|
99cbc7 |
create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display.xml
|
|
|
99cbc7 |
create mode 100644 tests/qemuxml2xmloutdata/hostdev-mdev-display.xml
|
|
|
99cbc7 |
|
|
|
99cbc7 |
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
|
|
|
99cbc7 |
index 9dd22554ad..3554c3dc30 100644
|
|
|
99cbc7 |
--- a/docs/formatdomain.html.in
|
|
|
99cbc7 |
+++ b/docs/formatdomain.html.in
|
|
|
99cbc7 |
@@ -4510,9 +4510,23 @@
|
|
|
99cbc7 |
guest. Currently, model='vfio-pci' and
|
|
|
99cbc7 |
model='vfio-ccw' (Since 4.4.0)
|
|
|
99cbc7 |
is supported. Refer MDEV to create
|
|
|
99cbc7 |
- a mediated device on the host. There are also some implications on the
|
|
|
99cbc7 |
- usage of guest's address type depending on the model
|
|
|
99cbc7 |
- attribute, see the address element below.
|
|
|
99cbc7 |
+ a mediated device on the host.
|
|
|
99cbc7 |
+ Since 4.6.0 (QEMU 2.12) an optional
|
|
|
99cbc7 |
+ display attribute may be used to enable or disable
|
|
|
99cbc7 |
+ support for an accelerated remote desktop backed by a mediated
|
|
|
99cbc7 |
+ device (such as NVIDIA vGPU or Intel GVT-g) as an alternative to
|
|
|
99cbc7 |
+ emulated video devices. This attribute
|
|
|
99cbc7 |
+ is limited to model='vfio-pci' only. Supported values
|
|
|
99cbc7 |
+ are either on or off (default is 'off').
|
|
|
99cbc7 |
+ It is required to use a
|
|
|
99cbc7 |
+ graphical framebuffer in order to
|
|
|
99cbc7 |
+ use this attribute, currently only supported with VNC, Spice and
|
|
|
99cbc7 |
+ egl-headless graphics devices.
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+ Note: There are also some implications on the usage of guest's
|
|
|
99cbc7 |
+ address type depending on the model attribute,
|
|
|
99cbc7 |
+ see the address element below.
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
|
|
|
99cbc7 |
|
|
|
99cbc7 |
|
|
|
99cbc7 |
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
|
|
|
99cbc7 |
index 157726752c..be8430ab22 100644
|
|
|
99cbc7 |
--- a/docs/schemas/domaincommon.rng
|
|
|
99cbc7 |
+++ b/docs/schemas/domaincommon.rng
|
|
|
99cbc7 |
@@ -4579,6 +4579,11 @@
|
|
|
99cbc7 |
<value>vfio-ccw</value>
|
|
|
99cbc7 |
</choice>
|
|
|
99cbc7 |
</attribute>
|
|
|
99cbc7 |
+ <optional>
|
|
|
99cbc7 |
+ <attribute name="display">
|
|
|
99cbc7 |
+ <ref name="virOnOff"/>
|
|
|
99cbc7 |
+ </attribute>
|
|
|
99cbc7 |
+ </optional>
|
|
|
99cbc7 |
<element name="source">
|
|
|
99cbc7 |
<ref name="mdevaddress"/>
|
|
|
99cbc7 |
</element>
|
|
|
99cbc7 |
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
|
99cbc7 |
index 72086f9e86..830c298158 100644
|
|
|
99cbc7 |
--- a/src/conf/domain_conf.c
|
|
|
99cbc7 |
+++ b/src/conf/domain_conf.c
|
|
|
99cbc7 |
@@ -7656,6 +7656,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
|
|
|
99cbc7 |
char *rawio = NULL;
|
|
|
99cbc7 |
char *backendStr = NULL;
|
|
|
99cbc7 |
char *model = NULL;
|
|
|
99cbc7 |
+ char *display = NULL;
|
|
|
99cbc7 |
int backend;
|
|
|
99cbc7 |
int ret = -1;
|
|
|
99cbc7 |
virDomainHostdevSubsysPCIPtr pcisrc = &def->source.subsys.u.pci;
|
|
|
99cbc7 |
@@ -7675,6 +7676,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
|
|
|
99cbc7 |
sgio = virXMLPropString(node, "sgio");
|
|
|
99cbc7 |
rawio = virXMLPropString(node, "rawio");
|
|
|
99cbc7 |
model = virXMLPropString(node, "model");
|
|
|
99cbc7 |
+ display = virXMLPropString(node, "display");
|
|
|
99cbc7 |
|
|
|
99cbc7 |
/* @type is passed in from the caller rather than read from the
|
|
|
99cbc7 |
* xml document, because it is specified in different places for
|
|
|
99cbc7 |
@@ -7762,6 +7764,15 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
|
|
|
99cbc7 |
model);
|
|
|
99cbc7 |
goto cleanup;
|
|
|
99cbc7 |
}
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+ if (display &&
|
|
|
99cbc7 |
+ (mdevsrc->display = virTristateSwitchTypeFromString(display)) <= 0) {
|
|
|
99cbc7 |
+ virReportError(VIR_ERR_XML_ERROR,
|
|
|
99cbc7 |
+ _("unknown value '%s' for <hostdev> attribute "
|
|
|
99cbc7 |
+ "'display'"),
|
|
|
99cbc7 |
+ display);
|
|
|
99cbc7 |
+ goto cleanup;
|
|
|
99cbc7 |
+ }
|
|
|
99cbc7 |
}
|
|
|
99cbc7 |
|
|
|
99cbc7 |
switch (def->source.subsys.type) {
|
|
|
99cbc7 |
@@ -7815,6 +7826,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
|
|
|
99cbc7 |
VIR_FREE(rawio);
|
|
|
99cbc7 |
VIR_FREE(backendStr);
|
|
|
99cbc7 |
VIR_FREE(model);
|
|
|
99cbc7 |
+ VIR_FREE(display);
|
|
|
99cbc7 |
return ret;
|
|
|
99cbc7 |
}
|
|
|
99cbc7 |
|
|
|
99cbc7 |
@@ -26568,9 +26580,14 @@ virDomainHostdevDefFormat(virBufferPtr buf,
|
|
|
99cbc7 |
virTristateBoolTypeToString(scsisrc->rawio));
|
|
|
99cbc7 |
}
|
|
|
99cbc7 |
|
|
|
99cbc7 |
- if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV)
|
|
|
99cbc7 |
+ if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV) {
|
|
|
99cbc7 |
virBufferAsprintf(buf, " model='%s'",
|
|
|
99cbc7 |
virMediatedDeviceModelTypeToString(mdevsrc->model));
|
|
|
99cbc7 |
+ if (mdevsrc->display != VIR_TRISTATE_SWITCH_ABSENT)
|
|
|
99cbc7 |
+ virBufferAsprintf(buf, " display='%s'",
|
|
|
99cbc7 |
+ virTristateSwitchTypeToString(mdevsrc->display));
|
|
|
99cbc7 |
+ }
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
}
|
|
|
99cbc7 |
virBufferAddLit(buf, ">\n");
|
|
|
99cbc7 |
virBufferAdjustIndent(buf, 2);
|
|
|
99cbc7 |
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
|
|
|
99cbc7 |
index 3deda1d978..8ca9558ceb 100644
|
|
|
99cbc7 |
--- a/src/conf/domain_conf.h
|
|
|
99cbc7 |
+++ b/src/conf/domain_conf.h
|
|
|
99cbc7 |
@@ -382,6 +382,7 @@ typedef struct _virDomainHostdevSubsysMediatedDev virDomainHostdevSubsysMediated
|
|
|
99cbc7 |
typedef virDomainHostdevSubsysMediatedDev *virDomainHostdevSubsysMediatedDevPtr;
|
|
|
99cbc7 |
struct _virDomainHostdevSubsysMediatedDev {
|
|
|
99cbc7 |
int model; /* enum virMediatedDeviceModelType */
|
|
|
99cbc7 |
+ int display; /* virTristateSwitch */
|
|
|
99cbc7 |
char uuidstr[VIR_UUID_STRING_BUFLEN]; /* mediated device's uuid string */
|
|
|
99cbc7 |
};
|
|
|
99cbc7 |
|
|
|
99cbc7 |
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
|
|
99cbc7 |
index 9498594857..5337f1ce55 100644
|
|
|
99cbc7 |
--- a/src/qemu/qemu_domain.c
|
|
|
99cbc7 |
+++ b/src/qemu/qemu_domain.c
|
|
|
99cbc7 |
@@ -4451,9 +4451,48 @@ qemuDomainDeviceDefValidateNetwork(const virDomainNetDef *net)
|
|
|
99cbc7 |
|
|
|
99cbc7 |
|
|
|
99cbc7 |
static int
|
|
|
99cbc7 |
-qemuDomainDeviceDefValidateHostdev(const virDomainHostdevDef *hostdev,
|
|
|
99cbc7 |
- const virDomainDef *def)
|
|
|
99cbc7 |
+qemuDomainMdevDefValidate(const virDomainHostdevSubsysMediatedDev *mdevsrc,
|
|
|
99cbc7 |
+ const virDomainDef *def,
|
|
|
99cbc7 |
+ virQEMUCapsPtr qemuCaps)
|
|
|
99cbc7 |
{
|
|
|
99cbc7 |
+ if (mdevsrc->display == VIR_TRISTATE_SWITCH_ABSENT)
|
|
|
99cbc7 |
+ return 0;
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_PCI_DISPLAY)) {
|
|
|
99cbc7 |
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
|
99cbc7 |
+ _("display property of device vfio-pci is "
|
|
|
99cbc7 |
+ "not supported by this version of QEMU"));
|
|
|
99cbc7 |
+ return -1;
|
|
|
99cbc7 |
+ }
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+ if (mdevsrc->model != VIR_MDEV_MODEL_TYPE_VFIO_PCI) {
|
|
|
99cbc7 |
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
|
99cbc7 |
+ _("<hostdev> attribute 'display' is only supported"
|
|
|
99cbc7 |
+ " with model='vfio-pci'"));
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+ return -1;
|
|
|
99cbc7 |
+ }
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+ if (mdevsrc->display == VIR_TRISTATE_SWITCH_ON) {
|
|
|
99cbc7 |
+ if (def->ngraphics == 0) {
|
|
|
99cbc7 |
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
|
99cbc7 |
+ _("graphics device is needed for attribute value "
|
|
|
99cbc7 |
+ "'display=on' in <hostdev>"));
|
|
|
99cbc7 |
+ return -1;
|
|
|
99cbc7 |
+ }
|
|
|
99cbc7 |
+ }
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+ return 0;
|
|
|
99cbc7 |
+}
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+static int
|
|
|
99cbc7 |
+qemuDomainDeviceDefValidateHostdev(const virDomainHostdevDef *hostdev,
|
|
|
99cbc7 |
+ const virDomainDef *def,
|
|
|
99cbc7 |
+ virQEMUCapsPtr qemuCaps)
|
|
|
99cbc7 |
+{
|
|
|
99cbc7 |
+ const virDomainHostdevSubsysMediatedDev *mdevsrc;
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
/* forbid capabilities mode hostdev in this kind of hypervisor */
|
|
|
99cbc7 |
if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) {
|
|
|
99cbc7 |
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
|
99cbc7 |
@@ -4463,6 +4502,24 @@ qemuDomainDeviceDefValidateHostdev(const virDomainHostdevDef *hostdev,
|
|
|
99cbc7 |
return -1;
|
|
|
99cbc7 |
}
|
|
|
99cbc7 |
|
|
|
99cbc7 |
+ if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
|
|
99cbc7 |
+ switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) {
|
|
|
99cbc7 |
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
|
|
99cbc7 |
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
|
|
99cbc7 |
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
|
|
|
99cbc7 |
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST:
|
|
|
99cbc7 |
+ break;
|
|
|
99cbc7 |
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV:
|
|
|
99cbc7 |
+ mdevsrc = &hostdev->source.subsys.u.mdev;
|
|
|
99cbc7 |
+ return qemuDomainMdevDefValidate(mdevsrc, def, qemuCaps);
|
|
|
99cbc7 |
+ case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
|
|
|
99cbc7 |
+ default:
|
|
|
99cbc7 |
+ virReportEnumRangeError(virDomainHostdevSubsysType,
|
|
|
99cbc7 |
+ hostdev->source.subsys.type);
|
|
|
99cbc7 |
+ return -1;
|
|
|
99cbc7 |
+ }
|
|
|
99cbc7 |
+ }
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
return 0;
|
|
|
99cbc7 |
}
|
|
|
99cbc7 |
|
|
|
99cbc7 |
@@ -5595,7 +5652,8 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
|
|
|
99cbc7 |
break;
|
|
|
99cbc7 |
|
|
|
99cbc7 |
case VIR_DOMAIN_DEVICE_HOSTDEV:
|
|
|
99cbc7 |
- ret = qemuDomainDeviceDefValidateHostdev(dev->data.hostdev, def);
|
|
|
99cbc7 |
+ ret = qemuDomainDeviceDefValidateHostdev(dev->data.hostdev, def,
|
|
|
99cbc7 |
+ qemuCaps);
|
|
|
99cbc7 |
break;
|
|
|
99cbc7 |
|
|
|
99cbc7 |
case VIR_DOMAIN_DEVICE_VIDEO:
|
|
|
99cbc7 |
@@ -6205,6 +6263,35 @@ qemuDomainVsockDefPostParse(virDomainVsockDefPtr vsock)
|
|
|
99cbc7 |
}
|
|
|
99cbc7 |
|
|
|
99cbc7 |
|
|
|
99cbc7 |
+static int
|
|
|
99cbc7 |
+qemuDomainHostdevDefMdevPostParse(virDomainHostdevSubsysMediatedDevPtr mdevsrc,
|
|
|
99cbc7 |
+ virQEMUCapsPtr qemuCaps)
|
|
|
99cbc7 |
+{
|
|
|
99cbc7 |
+ /* QEMU 2.12 added support for vfio-pci display type, we default to
|
|
|
99cbc7 |
+ * 'display=off' to stay safe from future changes */
|
|
|
99cbc7 |
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_PCI_DISPLAY) &&
|
|
|
99cbc7 |
+ mdevsrc->display == VIR_TRISTATE_SWITCH_ABSENT)
|
|
|
99cbc7 |
+ mdevsrc->display = VIR_TRISTATE_SWITCH_OFF;
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+ return 0;
|
|
|
99cbc7 |
+}
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+static int
|
|
|
99cbc7 |
+qemuDomainHostdevDefPostParse(virDomainHostdevDefPtr hostdev,
|
|
|
99cbc7 |
+ virQEMUCapsPtr qemuCaps)
|
|
|
99cbc7 |
+{
|
|
|
99cbc7 |
+ virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys;
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+ if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
|
|
99cbc7 |
+ hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV &&
|
|
|
99cbc7 |
+ qemuDomainHostdevDefMdevPostParse(&subsys->u.mdev, qemuCaps) < 0)
|
|
|
99cbc7 |
+ return -1;
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+ return 0;
|
|
|
99cbc7 |
+}
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
static int
|
|
|
99cbc7 |
qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
|
|
|
99cbc7 |
const virDomainDef *def,
|
|
|
99cbc7 |
@@ -6255,11 +6342,14 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
|
|
|
99cbc7 |
ret = qemuDomainVsockDefPostParse(dev->data.vsock);
|
|
|
99cbc7 |
break;
|
|
|
99cbc7 |
|
|
|
99cbc7 |
+ case VIR_DOMAIN_DEVICE_HOSTDEV:
|
|
|
99cbc7 |
+ ret = qemuDomainHostdevDefPostParse(dev->data.hostdev, qemuCaps);
|
|
|
99cbc7 |
+ break;
|
|
|
99cbc7 |
+
|
|
|
99cbc7 |
case VIR_DOMAIN_DEVICE_LEASE:
|
|
|
99cbc7 |
case VIR_DOMAIN_DEVICE_FS:
|
|
|
99cbc7 |
case VIR_DOMAIN_DEVICE_INPUT:
|
|
|
99cbc7 |
case VIR_DOMAIN_DEVICE_SOUND:
|
|
|
99cbc7 |
- case VIR_DOMAIN_DEVICE_HOSTDEV:
|
|
|
99cbc7 |
case VIR_DOMAIN_DEVICE_WATCHDOG:
|
|
|
99cbc7 |
case VIR_DOMAIN_DEVICE_GRAPHICS:
|
|
|
99cbc7 |
case VIR_DOMAIN_DEVICE_HUB:
|
|
|
99cbc7 |
diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display.xml b/tests/qemuxml2argvdata/hostdev-mdev-display.xml
|
|
|
99cbc7 |
new file mode 100644
|
|
|
99cbc7 |
index 0000000000..f37e08e1b9
|
|
|
99cbc7 |
--- /dev/null
|
|
|
99cbc7 |
+++ b/tests/qemuxml2argvdata/hostdev-mdev-display.xml
|
|
|
99cbc7 |
@@ -0,0 +1,39 @@
|
|
|
99cbc7 |
+<domain type='qemu'>
|
|
|
99cbc7 |
+ <name>QEMUGuest2</name>
|
|
|
99cbc7 |
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
|
|
99cbc7 |
+ <memory unit='KiB'>219136</memory>
|
|
|
99cbc7 |
+ <currentMemory unit='KiB'>219136</currentMemory>
|
|
|
99cbc7 |
+ <vcpu placement='static'>1</vcpu>
|
|
|
99cbc7 |
+ <os>
|
|
|
99cbc7 |
+ <type arch='i686' machine='pc'>hvm</type>
|
|
|
99cbc7 |
+ <boot dev='hd'/>
|
|
|
99cbc7 |
+ </os>
|
|
|
99cbc7 |
+ <clock offset='utc'/>
|
|
|
99cbc7 |
+ <on_poweroff>destroy</on_poweroff>
|
|
|
99cbc7 |
+ <on_reboot>restart</on_reboot>
|
|
|
99cbc7 |
+ <on_crash>destroy</on_crash>
|
|
|
99cbc7 |
+ <devices>
|
|
|
99cbc7 |
+ <emulator>/usr/bin/qemu-system-i686</emulator>
|
|
|
99cbc7 |
+ <disk type='block' device='disk'>
|
|
|
99cbc7 |
+ <driver name='qemu' type='raw'/>
|
|
|
99cbc7 |
+ <source dev='/dev/HostVG/QEMUGuest2'/>
|
|
|
99cbc7 |
+ <target dev='hda' bus='ide'/>
|
|
|
99cbc7 |
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
|
|
99cbc7 |
+ </disk>
|
|
|
99cbc7 |
+ <controller type='usb' index='0'>
|
|
|
99cbc7 |
+ </controller>
|
|
|
99cbc7 |
+ <controller type='pci' index='0' model='pci-root'/>
|
|
|
99cbc7 |
+ <controller type='ide' index='0'>
|
|
|
99cbc7 |
+ </controller>
|
|
|
99cbc7 |
+ <graphics type='vnc'/>
|
|
|
99cbc7 |
+ <hostdev mode='subsystem' type='mdev' model='vfio-pci' display='on'>
|
|
|
99cbc7 |
+ <source>
|
|
|
99cbc7 |
+ <address uuid='53764d0e-85a0-42b4-af5c-2046b460b1dc'/>
|
|
|
99cbc7 |
+ </source>
|
|
|
99cbc7 |
+ </hostdev>
|
|
|
99cbc7 |
+ <video>
|
|
|
99cbc7 |
+ <model type='qxl' heads='1'/>
|
|
|
99cbc7 |
+ </video>
|
|
|
99cbc7 |
+ <memballoon model='none'/>
|
|
|
99cbc7 |
+ </devices>
|
|
|
99cbc7 |
+</domain>
|
|
|
99cbc7 |
diff --git a/tests/qemuxml2xmloutdata/hostdev-mdev-display.xml b/tests/qemuxml2xmloutdata/hostdev-mdev-display.xml
|
|
|
99cbc7 |
new file mode 100644
|
|
|
99cbc7 |
index 0000000000..94c11b1199
|
|
|
99cbc7 |
--- /dev/null
|
|
|
99cbc7 |
+++ b/tests/qemuxml2xmloutdata/hostdev-mdev-display.xml
|
|
|
99cbc7 |
@@ -0,0 +1,47 @@
|
|
|
99cbc7 |
+<domain type='qemu'>
|
|
|
99cbc7 |
+ <name>QEMUGuest2</name>
|
|
|
99cbc7 |
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
|
|
99cbc7 |
+ <memory unit='KiB'>219136</memory>
|
|
|
99cbc7 |
+ <currentMemory unit='KiB'>219136</currentMemory>
|
|
|
99cbc7 |
+ <vcpu placement='static'>1</vcpu>
|
|
|
99cbc7 |
+ <os>
|
|
|
99cbc7 |
+ <type arch='i686' machine='pc'>hvm</type>
|
|
|
99cbc7 |
+ <boot dev='hd'/>
|
|
|
99cbc7 |
+ </os>
|
|
|
99cbc7 |
+ <clock offset='utc'/>
|
|
|
99cbc7 |
+ <on_poweroff>destroy</on_poweroff>
|
|
|
99cbc7 |
+ <on_reboot>restart</on_reboot>
|
|
|
99cbc7 |
+ <on_crash>destroy</on_crash>
|
|
|
99cbc7 |
+ <devices>
|
|
|
99cbc7 |
+ <emulator>/usr/bin/qemu-system-i686</emulator>
|
|
|
99cbc7 |
+ <disk type='block' device='disk'>
|
|
|
99cbc7 |
+ <driver name='qemu' type='raw'/>
|
|
|
99cbc7 |
+ <source dev='/dev/HostVG/QEMUGuest2'/>
|
|
|
99cbc7 |
+ <target dev='hda' bus='ide'/>
|
|
|
99cbc7 |
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
|
|
99cbc7 |
+ </disk>
|
|
|
99cbc7 |
+ <controller type='usb' index='0'>
|
|
|
99cbc7 |
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
|
|
99cbc7 |
+ </controller>
|
|
|
99cbc7 |
+ <controller type='pci' index='0' model='pci-root'/>
|
|
|
99cbc7 |
+ <controller type='ide' index='0'>
|
|
|
99cbc7 |
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
|
|
99cbc7 |
+ </controller>
|
|
|
99cbc7 |
+ <input type='mouse' bus='ps2'/>
|
|
|
99cbc7 |
+ <input type='keyboard' bus='ps2'/>
|
|
|
99cbc7 |
+ <graphics type='vnc' port='-1' autoport='yes'>
|
|
|
99cbc7 |
+ <listen type='address'/>
|
|
|
99cbc7 |
+ </graphics>
|
|
|
99cbc7 |
+ <video>
|
|
|
99cbc7 |
+ <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
|
|
|
99cbc7 |
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
|
|
99cbc7 |
+ </video>
|
|
|
99cbc7 |
+ <hostdev mode='subsystem' type='mdev' managed='no' model='vfio-pci' display='on'>
|
|
|
99cbc7 |
+ <source>
|
|
|
99cbc7 |
+ <address uuid='53764d0e-85a0-42b4-af5c-2046b460b1dc'/>
|
|
|
99cbc7 |
+ </source>
|
|
|
99cbc7 |
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
|
|
99cbc7 |
+ </hostdev>
|
|
|
99cbc7 |
+ <memballoon model='none'/>
|
|
|
99cbc7 |
+ </devices>
|
|
|
99cbc7 |
+</domain>
|
|
|
99cbc7 |
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
|
|
|
99cbc7 |
index fa57221d62..e418e67f6c 100644
|
|
|
99cbc7 |
--- a/tests/qemuxml2xmltest.c
|
|
|
99cbc7 |
+++ b/tests/qemuxml2xmltest.c
|
|
|
99cbc7 |
@@ -479,6 +479,7 @@ mymain(void)
|
|
|
99cbc7 |
DO_TEST("hostdev-pci-address", NONE);
|
|
|
99cbc7 |
DO_TEST("hostdev-vfio", NONE);
|
|
|
99cbc7 |
DO_TEST("hostdev-mdev-precreated", NONE);
|
|
|
99cbc7 |
+ DO_TEST("hostdev-mdev-display", QEMU_CAPS_VFIO_PCI_DISPLAY);
|
|
|
99cbc7 |
DO_TEST("pci-rom", NONE);
|
|
|
99cbc7 |
DO_TEST("pci-rom-disabled", NONE);
|
|
|
99cbc7 |
DO_TEST("pci-rom-disabled-invalid", NONE);
|
|
|
99cbc7 |
--
|
|
|
99cbc7 |
2.18.0
|
|
|
99cbc7 |
|