summaryrefslogtreecommitdiff
path: root/libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-09-12 01:06:10 +0000
committerCoprDistGit <infra@openeuler.org>2023-09-12 01:06:10 +0000
commitd6d9b3795aceb43d6aa1fcab85193e88049ce309 (patch)
tree6fc7120d35bbdccab9830f6b46100bbed6501bf6 /libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch
parent0081bffd55f7e9dc8df063521321178b95758d24 (diff)
automatic import of libvirtopeneuler22.03_LTS
Diffstat (limited to 'libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch')
-rw-r--r--libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch b/libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch
new file mode 100644
index 0000000..d33790c
--- /dev/null
+++ b/libvirt-RHEL-qemu-Add-check-for-unpriv-sgio-for-SCSI-generic-host-device.patch
@@ -0,0 +1,66 @@
+From d43807caf54d1ded1d79f5338ad63e4af9af3ca3 Mon Sep 17 00:00:00 2001
+Message-Id: <d43807caf54d1ded1d79f5338ad63e4af9af3ca3@dist-git>
+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>
+Signed-off-by: Ján Tomko <jtomko@redhat.com>
+Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
+---
+ src/qemu/qemu_conf.c | 20 ++++++++++++++++++--
+ 1 file changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
+index 3fee5fe687..12afed8aa2 100644
+--- a/src/qemu/qemu_conf.c
++++ b/src/qemu/qemu_conf.c
+@@ -1743,13 +1743,29 @@ qemuSharedHostdevAddRemoveInternal(virQEMUDriver *driver,
+ {
+ g_autofree char *dev_path = NULL;
+ g_autofree char *key = NULL;
++ virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi;
++ virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host;
+ int ret = -1;
+
+ if (!qemuIsSharedHostdev(hostdev))
+ return 0;
+
+- if (!(dev_path = qemuGetHostdevPath(hostdev)) ||
+- !(key = qemuGetSharedDeviceKey(dev_path)))
++ if (!(dev_path = qemuGetHostdevPath(hostdev)))
++ return -1;
++
++ 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);
++ }
++ return -1;
++ }
++
++ if (!(key = qemuGetSharedDeviceKey(dev_path)))
+ return -1;
+
+ qemuDriverLock(driver);
+--
+2.33.1
+