render / rpms / libvirt

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