2022-03-29 15:07:39 +00:00
|
|
|
From f562b4c83d342002291f6bd7c5776eaecbd3147f Mon Sep 17 00:00:00 2001
|
|
|
|
Message-Id: <f562b4c83d342002291f6bd7c5776eaecbd3147f@dist-git>
|
2019-08-06 18:16:05 +00:00
|
|
|
From: John Ferlan <jferlan@redhat.com>
|
|
|
|
Date: Mon, 17 Dec 2018 20:42:31 -0500
|
|
|
|
Subject: [PATCH] RHEL: qemu: Add check for unpriv sgio for SCSI generic host
|
|
|
|
device
|
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=1582424
|
|
|
|
|
|
|
|
RHEL-only
|
|
|
|
|
|
|
|
Check if the hostdev has set the sgio filtered/unfiltered and handle
|
|
|
|
appropriately.
|
|
|
|
|
|
|
|
This restores functionality removed by upstream commit id 'ce346623'
|
|
|
|
to remove sgio support for the SCSI generic host device.
|
|
|
|
|
|
|
|
Signed-off-by: John Ferlan <jferlan@redhat.com>
|
2022-03-29 15:07:39 +00:00
|
|
|
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
2019-08-06 18:16:05 +00:00
|
|
|
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
|
---
|
2020-07-28 06:55:52 +00:00
|
|
|
src/qemu/qemu_conf.c | 20 ++++++++++++++++++--
|
|
|
|
1 file changed, 18 insertions(+), 2 deletions(-)
|
2019-08-06 18:16:05 +00:00
|
|
|
|
|
|
|
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
|
2022-03-29 15:07:39 +00:00
|
|
|
index ba85fc6e22..28c334761b 100644
|
2019-08-06 18:16:05 +00:00
|
|
|
--- a/src/qemu/qemu_conf.c
|
|
|
|
+++ b/src/qemu/qemu_conf.c
|
2022-03-29 15:07:39 +00:00
|
|
|
@@ -1749,13 +1749,29 @@ qemuSharedHostdevAddRemoveInternal(virQEMUDriver *driver,
|
2019-08-06 18:16:05 +00:00
|
|
|
{
|
2020-07-28 06:55:52 +00:00
|
|
|
g_autofree char *dev_path = NULL;
|
|
|
|
g_autofree char *key = NULL;
|
2022-03-29 15:07:39 +00:00
|
|
|
+ virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi;
|
|
|
|
+ virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host;
|
2019-08-06 18:16:05 +00:00
|
|
|
int ret = -1;
|
|
|
|
|
|
|
|
if (!qemuIsSharedHostdev(hostdev))
|
2020-07-28 06:55:52 +00:00
|
|
|
return 0;
|
2019-08-06 18:16:05 +00:00
|
|
|
|
2020-07-28 06:55:52 +00:00
|
|
|
- if (!(dev_path = qemuGetHostdevPath(hostdev)) ||
|
|
|
|
- !(key = qemuGetSharedDeviceKey(dev_path)))
|
|
|
|
+ if (!(dev_path = qemuGetHostdevPath(hostdev)))
|
|
|
|
+ return -1;
|
|
|
|
+
|
2019-08-06 18:16:05 +00:00
|
|
|
+ if ((ret = qemuCheckUnprivSGIO(driver->sharedDevices, dev_path,
|
|
|
|
+ scsisrc->sgio)) < 0) {
|
|
|
|
+ if (ret == -2) {
|
|
|
|
+ virReportError(VIR_ERR_OPERATION_INVALID,
|
|
|
|
+ _("sgio of shared scsi host device '%s-%u-%u-%llu' "
|
|
|
|
+ "conflicts with other active domains"),
|
|
|
|
+ scsihostsrc->adapter, scsihostsrc->bus,
|
|
|
|
+ scsihostsrc->target, scsihostsrc->unit);
|
|
|
|
+ }
|
2020-07-28 06:55:52 +00:00
|
|
|
+ return -1;
|
2019-08-06 18:16:05 +00:00
|
|
|
+ }
|
|
|
|
+
|
2020-07-28 06:55:52 +00:00
|
|
|
+ if (!(key = qemuGetSharedDeviceKey(dev_path)))
|
|
|
|
return -1;
|
2019-08-06 18:16:05 +00:00
|
|
|
|
2020-07-28 06:55:52 +00:00
|
|
|
qemuDriverLock(driver);
|
2019-08-06 18:16:05 +00:00
|
|
|
--
|
2022-03-29 15:07:39 +00:00
|
|
|
2.34.1
|
2019-08-06 18:16:05 +00:00
|
|
|
|