Blame SOURCES/libvirt-qemu-qemuBuildHostdevCommandLine-Use-a-helper-variable-mdevsrc.patch

edecca
From d34cb86a2b1710c3800dbe84dd7d7e6b12fb691c Mon Sep 17 00:00:00 2001
edecca
Message-Id: <d34cb86a2b1710c3800dbe84dd7d7e6b12fb691c@dist-git>
edecca
From: Erik Skultety <eskultet@redhat.com>
edecca
Date: Thu, 19 Jul 2018 15:03:56 +0200
edecca
Subject: [PATCH] qemu: qemuBuildHostdevCommandLine: Use a helper variable
edecca
 mdevsrc
edecca
MIME-Version: 1.0
edecca
Content-Type: text/plain; charset=UTF-8
edecca
Content-Transfer-Encoding: 8bit
edecca
edecca
Decrease the number of accessors we have to use.
edecca
edecca
Reviewed-by: Ján Tomko <jtomko@redhat.com>
edecca
Signed-off-by: Erik Skultety <eskultet@redhat.com>
edecca
(cherry picked from commit 3b61f333acd9266ff4f09e37515130d67d496f74)
edecca
edecca
https://bugzilla.redhat.com/show_bug.cgi?id=1475770
edecca
Signed-off-by: Erik Skultety <eskultet@redhat.com>
edecca
Reviewed-by: Ján Tomko <jtomko@redhat.com>
edecca
---
edecca
 src/qemu/qemu_command.c | 5 ++++-
edecca
 1 file changed, 4 insertions(+), 1 deletion(-)
edecca
edecca
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
edecca
index 8a8cbfd7f6..fed4f8faf9 100644
edecca
--- a/src/qemu/qemu_command.c
edecca
+++ b/src/qemu/qemu_command.c
edecca
@@ -5394,7 +5394,9 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
edecca
 
edecca
         /* MDEV */
edecca
         if (virHostdevIsMdevDevice(hostdev)) {
edecca
-            switch ((virMediatedDeviceModelType) subsys->u.mdev.model) {
edecca
+            virDomainHostdevSubsysMediatedDevPtr mdevsrc = &subsys->u.mdev;
edecca
+
edecca
+            switch ((virMediatedDeviceModelType) mdevsrc->model) {
edecca
             case VIR_MDEV_MODEL_TYPE_VFIO_PCI:
edecca
                 if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
edecca
                     virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
edecca
@@ -5402,6 +5404,7 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
edecca
                                      "supported by this version of QEMU"));
edecca
                     return -1;
edecca
                 }
edecca
+
edecca
                 break;
edecca
             case VIR_MDEV_MODEL_TYPE_VFIO_CCW:
edecca
                 if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_CCW)) {
edecca
-- 
edecca
2.18.0
edecca