render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c1c534
From dbb91baa8d629753ac7a686ca38a621553875005 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <dbb91baa8d629753ac7a686ca38a621553875005@dist-git>
c1c534
From: Peter Krempa <pkrempa@redhat.com>
c1c534
Date: Thu, 23 Nov 2017 19:02:22 +0100
c1c534
Subject: [PATCH] qemu: caps: Add capability for 'share-rw' disk option
c1c534
c1c534
'share-rw' for the disk device configures qemu to allow concurrent
c1c534
access to the backing storage.
c1c534
c1c534
The capability is checked in various supported disk frontend buses since
c1c534
it does not make sense to partially backport it.
c1c534
c1c534
(cherry picked from commit 860a3c4bea1d24773d8a495f213d5de3ac48a462)
c1c534
c1c534
 Conflicts:
c1c534
	src/qemu/qemu_capabilities.c
c1c534
	src/qemu/qemu_capabilities.h
c1c534
c1c534
        Few capabilities were not backported, so I left empty space
c1c534
        instead.
c1c534
c1c534
	tests/qemucapabilitiesdata/caps_2.10.0-gicv2.aarch64.xml
c1c534
	tests/qemucapabilitiesdata/caps_2.10.0-gicv3.aarch64.xml
c1c534
	tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
c1c534
	tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
c1c534
	tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
c1c534
	tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
c1c534
	tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml
c1c534
c1c534
        Some of the test files were missing and the rest had conflict
c1c534
        due to the above capabilities not being backported.
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1378242
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/qemu/qemu_capabilities.c                      | 11 +++++++++++
c1c534
 src/qemu/qemu_capabilities.h                      |  7 +++++++
c1c534
 tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml  |  1 +
c1c534
 tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml  |  1 +
c1c534
 tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml |  1 +
c1c534
 tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml   |  1 +
c1c534
 tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml   |  1 +
c1c534
 tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml  |  1 +
c1c534
 8 files changed, 24 insertions(+)
c1c534
c1c534
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
c1c534
index f30d2fa09e..2f41e076cb 100644
c1c534
--- a/src/qemu/qemu_capabilities.c
c1c534
+++ b/src/qemu/qemu_capabilities.c
c1c534
@@ -444,6 +444,13 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
c1c534
               "vxhs",
c1c534
               "virtio-blk.num-queues",
c1c534
               "machine.pseries.resize-hpt",
c1c534
+
c1c534
+
c1c534
+
c1c534
+              /* 275 */
c1c534
+
c1c534
+
c1c534
+              "disk-share-rw",
c1c534
     );
c1c534
 
c1c534
 
c1c534
@@ -1686,6 +1693,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = {
c1c534
     { "scsi", QEMU_CAPS_VIRTIO_BLK_SCSI },
c1c534
     { "logical_block_size", QEMU_CAPS_BLOCKIO },
c1c534
     { "num-queues", QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES },
c1c534
+    { "share-rw", QEMU_CAPS_DISK_SHARE_RW },
c1c534
 };
c1c534
 
c1c534
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] = {
c1c534
@@ -1716,10 +1724,12 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVfioPCI[] = {
c1c534
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSCSIDisk[] = {
c1c534
     { "channel", QEMU_CAPS_SCSI_DISK_CHANNEL },
c1c534
     { "wwn", QEMU_CAPS_SCSI_DISK_WWN },
c1c534
+    { "share-rw", QEMU_CAPS_DISK_SHARE_RW },
c1c534
 };
c1c534
 
c1c534
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIDEDrive[] = {
c1c534
     { "wwn", QEMU_CAPS_IDE_DRIVE_WWN },
c1c534
+    { "share-rw", QEMU_CAPS_DISK_SHARE_RW },
c1c534
 };
c1c534
 
c1c534
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPiix4PM[] = {
c1c534
@@ -1750,6 +1760,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQ35PCIHost[] = {
c1c534
 
c1c534
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBStorage[] = {
c1c534
     { "removable", QEMU_CAPS_USB_STORAGE_REMOVABLE },
c1c534
+    { "share-rw", QEMU_CAPS_DISK_SHARE_RW },
c1c534
 };
c1c534
 
c1c534
 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsKVMPit[] = {
c1c534
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
c1c534
index e7d766f801..60818daa1c 100644
c1c534
--- a/src/qemu/qemu_capabilities.h
c1c534
+++ b/src/qemu/qemu_capabilities.h
c1c534
@@ -431,6 +431,13 @@ typedef enum {
c1c534
     QEMU_CAPS_VIRTIO_BLK_NUM_QUEUES, /* virtio-blk-*.num-queues */
c1c534
     QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, /* -machine pseries,resize-hpt */
c1c534
 
c1c534
+
c1c534
+
c1c534
+    /* 275 */
c1c534
+
c1c534
+
c1c534
+    QEMU_CAPS_DISK_SHARE_RW, /* share-rw=on for concurrent disk access */
c1c534
+
c1c534
     QEMU_CAPS_LAST /* this must always be the last item */
c1c534
 } virQEMUCapsFlags;
c1c534
 
c1c534
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
c1c534
index b0ee3f1523..c01777a5a3 100644
c1c534
--- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
c1c534
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
c1c534
@@ -178,6 +178,7 @@
c1c534
   <flag name='vxhs'/>
c1c534
   <flag name='virtio-blk.num-queues'/>
c1c534
   <flag name='machine.pseries.resize-hpt'/>
c1c534
+  <flag name='disk-share-rw'/>
c1c534
   <version>2010000</version>
c1c534
   <kvmVersion>0</kvmVersion>
c1c534
   <package> (v2.10.0)</package>
c1c534
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
c1c534
index 7e44652feb..a6900bf1ef 100644
c1c534
--- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
c1c534
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml
c1c534
@@ -141,6 +141,7 @@
c1c534
   <flag name='virtio-gpu.max_outputs'/>
c1c534
   <flag name='vxhs'/>
c1c534
   <flag name='virtio-blk.num-queues'/>
c1c534
+  <flag name='disk-share-rw'/>
c1c534
   <version>2010000</version>
c1c534
   <kvmVersion>0</kvmVersion>
c1c534
   <package></package>
c1c534
diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
c1c534
index ddbd8c32fa..33db3e6674 100644
c1c534
--- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
c1c534
+++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml
c1c534
@@ -224,6 +224,7 @@
c1c534
   <flag name='virtio-gpu.max_outputs'/>
c1c534
   <flag name='vxhs'/>
c1c534
   <flag name='virtio-blk.num-queues'/>
c1c534
+  <flag name='disk-share-rw'/>
c1c534
   <version>2010000</version>
c1c534
   <kvmVersion>0</kvmVersion>
c1c534
   <package> (v2.10.0)</package>
c1c534
diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
c1c534
index 786cea8eab..e912211f40 100644
c1c534
--- a/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
c1c534
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml
c1c534
@@ -173,6 +173,7 @@
c1c534
   <flag name='chardev-reconnect'/>
c1c534
   <flag name='virtio-gpu.max_outputs'/>
c1c534
   <flag name='virtio-blk.num-queues'/>
c1c534
+  <flag name='disk-share-rw'/>
c1c534
   <version>2009000</version>
c1c534
   <kvmVersion>0</kvmVersion>
c1c534
   <package> (v2.9.0)</package>
c1c534
diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml
c1c534
index 896ed503c3..4150b8eee7 100644
c1c534
--- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml
c1c534
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml
c1c534
@@ -138,6 +138,7 @@
c1c534
   <flag name='chardev-reconnect'/>
c1c534
   <flag name='virtio-gpu.max_outputs'/>
c1c534
   <flag name='virtio-blk.num-queues'/>
c1c534
+  <flag name='disk-share-rw'/>
c1c534
   <version>2009000</version>
c1c534
   <kvmVersion>0</kvmVersion>
c1c534
   <package></package>
c1c534
diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
c1c534
index 05f9dc0308..0ea9a2fce3 100644
c1c534
--- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
c1c534
+++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml
c1c534
@@ -221,6 +221,7 @@
c1c534
   <flag name='chardev-reconnect'/>
c1c534
   <flag name='virtio-gpu.max_outputs'/>
c1c534
   <flag name='virtio-blk.num-queues'/>
c1c534
+  <flag name='disk-share-rw'/>
c1c534
   <version>2009000</version>
c1c534
   <kvmVersion>0</kvmVersion>
c1c534
   <package> (v2.9.0)</package>
c1c534
-- 
c1c534
2.15.0
c1c534