2021-06-07 10:19:34 +00:00
|
|
|
From c4182edf706fda88e3f144de3c93983b7a6c21b5 Mon Sep 17 00:00:00 2001
|
|
|
|
Message-Id: <c4182edf706fda88e3f144de3c93983b7a6c21b5@dist-git>
|
libvirt-7.3.0-1.el9
- Rebased to libvirt-7.3.0 (rhbz#1950948)
- The rebase also fixes the following bugs:
rhbz#1898526, rhbz#1910617, rhbz#1910618, rhbz#1943392, rhbz#1946918
rhbz#1947718, rhbz#1947720, rhbz#1947824, rhbz#1949342, rhbz#1950228
rhbz#1950301, rhbz#1950601, rhbz#1950948, rhbz#1953939, rhbz#1958302
rhbz#1962053
- RHEL: Enable usage of x-blockdev-reopen (rhbz#1953939)
- RHEL: Add gating.yaml for RHEL9 (rhbz#1950601)
Resolves: rhbz#1898526, rhbz#1910617, rhbz#1910618, rhbz#1943392, rhbz#1946918
Resolves: rhbz#1947718, rhbz#1947720, rhbz#1947824, rhbz#1949342, rhbz#1950228
Resolves: rhbz#1950301, rhbz#1950601, rhbz#1950948, rhbz#1953939, rhbz#1958302
Resolves: rhbz#1962053
2021-05-24 16:44:48 +00:00
|
|
|
From: John Ferlan <jferlan@redhat.com>
|
|
|
|
Date: Mon, 17 Dec 2018 20:42:30 -0500
|
|
|
|
Subject: [PATCH] RHEL: qemu: Add ability to set sgio values for hostdev
|
|
|
|
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
|
|
|
|
|
|
|
|
Add necessary checks in order to allow setting sgio values for a scsi
|
|
|
|
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 | 25 ++++++++++++++++---------
|
|
|
|
1 file changed, 16 insertions(+), 9 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
|
|
|
|
index 916a3d36ee..a749fc1bbc 100644
|
|
|
|
--- a/src/qemu/qemu_conf.c
|
|
|
|
+++ b/src/qemu/qemu_conf.c
|
|
|
|
@@ -1836,8 +1836,9 @@ qemuSetUnprivSGIO(virDomainDeviceDef *dev)
|
|
|
|
virDomainDiskDef *disk = NULL;
|
|
|
|
virDomainHostdevDef *hostdev = NULL;
|
|
|
|
g_autofree char *sysfs_path = NULL;
|
|
|
|
+ g_autofree char *hostdev_path = NULL;
|
|
|
|
const char *path = NULL;
|
|
|
|
- int val = -1;
|
|
|
|
+ int val = 0;
|
|
|
|
|
|
|
|
/* "sgio" is only valid for block disk; cdrom
|
|
|
|
* and floopy disk can have empty source.
|
|
|
|
@@ -1853,17 +1854,14 @@ qemuSetUnprivSGIO(virDomainDeviceDef *dev)
|
|
|
|
} else if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
|
|
|
|
hostdev = dev->data.hostdev;
|
|
|
|
|
|
|
|
- if (!qemuIsSharedHostdev(hostdev))
|
|
|
|
+ if (hostdev->source.subsys.u.scsi.protocol ==
|
|
|
|
+ VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
- if (hostdev->source.subsys.u.scsi.sgio) {
|
|
|
|
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
|
|
- _("'sgio' is not supported for SCSI "
|
|
|
|
- "generic device yet "));
|
|
|
|
+ if (!(hostdev_path = qemuGetHostdevPath(hostdev)))
|
|
|
|
return -1;
|
|
|
|
- }
|
|
|
|
|
|
|
|
- return 0;
|
|
|
|
+ path = hostdev_path;
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
@@ -1872,7 +1870,16 @@ qemuSetUnprivSGIO(virDomainDeviceDef *dev)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
/* By default, filter the SG_IO commands, i.e. set unpriv_sgio to 0. */
|
|
|
|
- val = (disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED);
|
|
|
|
+ if (dev->type == VIR_DOMAIN_DEVICE_DISK) {
|
|
|
|
+ if (disk->sgio == VIR_DOMAIN_DEVICE_SGIO_UNFILTERED)
|
|
|
|
+ val = 1;
|
|
|
|
+ } else {
|
|
|
|
+ /* Only settable if <shareable/> was present for hostdev */
|
|
|
|
+ if (qemuIsSharedHostdev(hostdev) &&
|
|
|
|
+ hostdev->source.subsys.u.scsi.sgio ==
|
|
|
|
+ VIR_DOMAIN_DEVICE_SGIO_UNFILTERED)
|
|
|
|
+ val = 1;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/* Do not do anything if unpriv_sgio is not supported by the kernel and the
|
|
|
|
* whitelist is enabled. But if requesting unfiltered access, always call
|
|
|
|
--
|
|
|
|
2.31.1
|
|
|
|
|