render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
fbe740
From 163740bff28c6f1a82663bc652f2cd5df39e4276 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <163740bff28c6f1a82663bc652f2cd5df39e4276@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
fbe740
index 0674292fab..3d2f0e7bbb 100644
9c6c51
--- a/src/qemu/qemu_conf.c
9c6c51
+++ b/src/qemu/qemu_conf.c
fbe740
@@ -1844,6 +1844,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)))
fbe740
             return -1;
9c6c51
 
9c6c51
-- 
fbe740
2.25.0
9c6c51