render / rpms / libvirt

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