render / rpms / libvirt

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