render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
edecca
From f5ff3821c1171718af9164be9002d3acfeb12cf2 Mon Sep 17 00:00:00 2001
edecca
Message-Id: <f5ff3821c1171718af9164be9002d3acfeb12cf2@dist-git>
edecca
From: Farhan Ali <alifm@linux.ibm.com>
edecca
Date: Mon, 3 Sep 2018 09:58:50 +0200
edecca
Subject: [PATCH] qemu: mdev: Use vfio-pci 'display' property only with
edecca
 vfio-pci mdevs
edecca
edecca
S390 is aware of both vfio-pci and vfio-ccw devices, so
edecca
on S390 the capability QEMU_CAPS_VFIO_PCI_DISPLAY will be
edecca
available. Add an extra check to make sure we only set the
edecca
display to off for vfio-pci mediated devices. Otherwise we
edecca
add display for vfio-ccw device and this breaks vfio-ccw
edecca
device qemu command line.
edecca
edecca
Fixes: d54e45b6e conf: Introduce new <hostdev> attribute 'display'
edecca
Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
edecca
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
edecca
Reviewed-by: Erik Skultety <eskultet@redhat.com>
edecca
(cherry picked from commit d6f97d1338ba9470f7c745fab317d272cde84d38)
edecca
edecca
RHEL-7.6: https://bugzilla.redhat.com/show_bug.cgi?id=1624735
edecca
RHEL-8.0: https://bugzilla.redhat.com/show_bug.cgi?id=1624740
edecca
Signed-off-by: Erik Skultety <eskultet@redhat.com>
edecca
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
edecca
---
edecca
 src/qemu/qemu_domain.c | 1 +
edecca
 1 file changed, 1 insertion(+)
edecca
edecca
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
edecca
index 508846116b..17be6e5537 100644
edecca
--- a/src/qemu/qemu_domain.c
edecca
+++ b/src/qemu/qemu_domain.c
edecca
@@ -6272,6 +6272,7 @@ qemuDomainHostdevDefMdevPostParse(virDomainHostdevSubsysMediatedDevPtr mdevsrc,
edecca
     /* QEMU 2.12 added support for vfio-pci display type, we default to
edecca
      * 'display=off' to stay safe from future changes */
edecca
     if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VFIO_PCI_DISPLAY) &&
edecca
+        mdevsrc->model == VIR_MDEV_MODEL_TYPE_VFIO_PCI &&
edecca
         mdevsrc->display == VIR_TRISTATE_SWITCH_ABSENT)
edecca
         mdevsrc->display = VIR_TRISTATE_SWITCH_OFF;
edecca
 
edecca
-- 
edecca
2.18.0
edecca