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