render / rpms / libvirt

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