render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
edecca
From 11bfd4f26c090b95a100aaf056ecfa799dfce979 Mon Sep 17 00:00:00 2001
edecca
Message-Id: <11bfd4f26c090b95a100aaf056ecfa799dfce979@dist-git>
edecca
From: John Ferlan <jferlan@redhat.com>
edecca
Date: Fri, 25 Jan 2019 12:19:12 -0500
edecca
Subject: [PATCH] RHEL: qemu: Fix crash trying to use iSCSI hostdev
edecca
MIME-Version: 1.0
edecca
Content-Type: text/plain; charset=UTF-8
edecca
Content-Transfer-Encoding: 8bit
edecca
edecca
https://bugzilla.redhat.com/show_bug.cgi?id=1669424
edecca
https://bugzilla.redhat.com/show_bug.cgi?id=1669966
edecca
edecca
RHEL-only
edecca
edecca
Commit 861a1a4d2 moved the qemuIsSharedHostdev filter in the
edecca
HOSTDEV half of the logic to allow calling qemuGetHostdevPath;
edecca
however, that neglected to check whether the SCSI hostdev was
edecca
using the iSCSI protocol which has a different overlayed struct
edecca
format (u.iscsi vs. u.host) resulting in attempted access of
edecca
u.host when calling virSCSIDeviceGetDevName.
edecca
edecca
Signed-off-by: John Ferlan <jferlan@redhat.com>
edecca
Reviewed-by: Ján Tomko <jtomko@redhat.com>
edecca
---
edecca
 src/qemu/qemu_conf.c | 4 ++++
edecca
 1 file changed, 4 insertions(+)
edecca
edecca
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
edecca
index 768e9d8308..a81298326f 100644
edecca
--- a/src/qemu/qemu_conf.c
edecca
+++ b/src/qemu/qemu_conf.c
edecca
@@ -1667,6 +1667,10 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
edecca
     } else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
edecca
         hostdev = dev->data.hostdev;
edecca
 
edecca
+        if (hostdev->source.subsys.u.scsi.protocol ==
edecca
+            VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
edecca
+            return 0;
edecca
+
edecca
         if (!(hostdev_path = qemuGetHostdevPath(hostdev)))
edecca
             goto cleanup;
edecca
 
edecca
-- 
edecca
2.20.1
edecca