|
|
7a3408 |
From 4b1391cc3a879f4a82510742d0f1dc668d23de94 Mon Sep 17 00:00:00 2001
|
|
|
7a3408 |
Message-Id: <4b1391cc3a879f4a82510742d0f1dc668d23de94@dist-git>
|
|
|
7a3408 |
From: John Ferlan <jferlan@redhat.com>
|
|
|
7a3408 |
Date: Thu, 9 Jul 2015 08:28:58 -0400
|
|
|
7a3408 |
Subject: [PATCH] RHEL: qemu: Add check for unpriv sgio for SCSI generic host
|
|
|
7a3408 |
device
|
|
|
7a3408 |
|
|
|
7a3408 |
https://bugzilla.redhat.com/show_bug.cgi?id=1072736
|
|
|
7a3408 |
|
|
|
7a3408 |
RHEL-only
|
|
|
7a3408 |
|
|
|
7a3408 |
Check if the hostdev has set the sgio filtered/unfiltered and handle
|
|
|
7a3408 |
appropriately.
|
|
|
7a3408 |
|
|
|
7a3408 |
This restores functionality removed by upstream commit id 'ce346623'
|
|
|
7a3408 |
to remove sgio support for the SCSI generic host device.
|
|
|
7a3408 |
|
|
|
7a3408 |
Signed-off-by: John Ferlan <jferlan@redhat.com>
|
|
|
7a3408 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
7a3408 |
---
|
|
|
7a3408 |
src/qemu/qemu_conf.c | 15 +++++++++++++++
|
|
|
7a3408 |
1 file changed, 15 insertions(+)
|
|
|
7a3408 |
|
|
|
7a3408 |
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
|
|
|
7a3408 |
index aa2d1de..965d34d 100644
|
|
|
7a3408 |
--- a/src/qemu/qemu_conf.c
|
|
|
7a3408 |
+++ b/src/qemu/qemu_conf.c
|
|
|
7a3408 |
@@ -1274,6 +1274,8 @@ qemuAddSharedHostdev(virQEMUDriverPtr driver,
|
|
|
7a3408 |
{
|
|
|
7a3408 |
char *dev_path = NULL;
|
|
|
7a3408 |
char *key = NULL;
|
|
|
7a3408 |
+ virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi;
|
|
|
7a3408 |
+ virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host;
|
|
|
7a3408 |
int ret = -1;
|
|
|
7a3408 |
|
|
|
7a3408 |
if (!qemuIsSharedHostdev(hostdev))
|
|
|
7a3408 |
@@ -1282,6 +1284,19 @@ qemuAddSharedHostdev(virQEMUDriverPtr driver,
|
|
|
7a3408 |
if (!(dev_path = qemuGetHostdevPath(hostdev)))
|
|
|
7a3408 |
goto cleanup;
|
|
|
7a3408 |
|
|
|
7a3408 |
+ if ((ret = qemuCheckUnprivSGIO(driver->sharedDevices, dev_path,
|
|
|
7a3408 |
+ scsisrc->sgio)) < 0) {
|
|
|
7a3408 |
+ if (ret == -2) {
|
|
|
7a3408 |
+ virReportError(VIR_ERR_OPERATION_INVALID,
|
|
|
7a3408 |
+ _("sgio of shared scsi host device '%s-%u-%u-%llu' "
|
|
|
7a3408 |
+ "conflicts with other active domains"),
|
|
|
7a3408 |
+ scsihostsrc->adapter, scsihostsrc->bus,
|
|
|
7a3408 |
+ scsihostsrc->target, scsihostsrc->unit);
|
|
|
7a3408 |
+ ret = -1;
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ goto cleanup;
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+
|
|
|
7a3408 |
if (!(key = qemuGetSharedDeviceKey(dev_path)))
|
|
|
7a3408 |
goto cleanup;
|
|
|
7a3408 |
|
|
|
7a3408 |
--
|
|
|
7a3408 |
2.5.1
|
|
|
7a3408 |
|