render / rpms / libvirt

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