2020-07-28 06:55:52 +00:00
|
|
|
From e79d54ff8e760ac1a200a37fb05cc9aa758c48d3 Mon Sep 17 00:00:00 2001
|
|
|
|
Message-Id: <e79d54ff8e760ac1a200a37fb05cc9aa758c48d3@dist-git>
|
2019-08-06 18:16:05 +00:00
|
|
|
From: John Ferlan <jferlan@redhat.com>
|
|
|
|
Date: Mon, 17 Dec 2018 20:42:33 -0500
|
2020-07-28 06:55:52 +00:00
|
|
|
Subject: [PATCH] RHEL: qemu: Alter qemuSetUnprivSGIO hostdev shareable logic
|
2019-08-06 18:16:05 +00:00
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=1656362 (RHEL8)
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=1656360 (RHEL7)
|
|
|
|
|
|
|
|
RHEL-only
|
|
|
|
|
|
|
|
Fix the logic to handle the case where if the <shareable/> element
|
|
|
|
was removed from the domain <hostdev.../>, then we have to reset the
|
|
|
|
SGIO value back to 0. Without this patch the check for not shareable
|
|
|
|
and return 0 would bypass resetting the value back to 0.
|
|
|
|
|
|
|
|
Signed-off-by: John Ferlan <jferlan@redhat.com>
|
|
|
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
|
---
|
|
|
|
src/qemu/qemu_conf.c | 7 +++----
|
|
|
|
1 file changed, 3 insertions(+), 4 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
|
2020-07-28 06:55:52 +00:00
|
|
|
index faabc4d49f..590052b035 100644
|
2019-08-06 18:16:05 +00:00
|
|
|
--- a/src/qemu/qemu_conf.c
|
|
|
|
+++ b/src/qemu/qemu_conf.c
|
2020-07-28 06:55:52 +00:00
|
|
|
@@ -1844,9 +1844,6 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
|
2019-08-06 18:16:05 +00:00
|
|
|
} else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
|
|
|
|
hostdev = dev->data.hostdev;
|
|
|
|
|
|
|
|
- if (!qemuIsSharedHostdev(hostdev))
|
|
|
|
- return 0;
|
|
|
|
-
|
|
|
|
if (!(hostdev_path = qemuGetHostdevPath(hostdev)))
|
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
|
|
|
@@ -1863,7 +1860,9 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
|
2019-08-06 18:16:05 +00:00
|
|
|
disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED) {
|
|
|
|
val = 1;
|
|
|
|
} else {
|
|
|
|
- if (hostdev->source.subsys.u.scsi.sgio ==
|
|
|
|
+ /* Only settable if <shareable/> was present for hostdev */
|
|
|
|
+ if (qemuIsSharedHostdev(hostdev) &&
|
|
|
|
+ hostdev->source.subsys.u.scsi.sgio ==
|
|
|
|
VIR_DOMAIN_DEVICE_SGIO_UNFILTERED)
|
|
|
|
val = 1;
|
|
|
|
}
|
|
|
|
--
|
2020-07-28 06:55:52 +00:00
|
|
|
2.25.0
|
2019-08-06 18:16:05 +00:00
|
|
|
|