File libvirt-blockjob-add-qemu-capabilities-related-to-block-jobs.patch of Package libvirt

From 721807d5c6134ec45d748bcda941fa877b606f0b Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Thu, 2 Aug 2012 14:57:45 +0800
Subject: [PATCH] blockjob: add qemu capabilities related to block jobs
To: libvir-list@redhat.com

https://bugzilla.redhat.com/show_bug.cgi?id=837787
RHEL-only; this is the minimal patch extracted from
https://bugzilla.redhat.com/show_bug.cgi?id=638506
while waiting for upstream drive-mirror to hit RHEL 6.4.

Adding these capabilities while leaving them always 0 will
mean that libvirt 0.10.0-rc0-1.el6 can parse the XML
generated by 0.9.10-21.el6*.

Eventually, upstream libvirt will support these commands
for real, at which point we will rebase to the upstream
version of this patch; I will make sure upstream uses the
capability name 'drive-reopen' for the 'block-job-complete'
command, for maximal compatibility with RHEL 6.3.

* src/qemu/qemu_capabilities.h (qemuCapsFlags): Add two bits.
* src/qemu/qemu_capabilities.c (qemuCaps): Name them.

Small fix in src/qemu/qemu_capabilities.c to apply on top of
other RHEL-only patches

 src/qemu/qemu_capabilities.c |  6 ++++++
 src/qemu/qemu_capabilities.h | 10 ++++++++++
 2 files changed, 16 insertions(+)

Signed-off-by: Daniel Veillard <veillard@redhat.com>
---
 src/qemu/qemu_capabilities.c |  6 ++++++
 src/qemu/qemu_capabilities.h | 10 ++++++++++
 2 files changed, 16 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index c38fcc0..1c2d3fb 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -185,6 +185,12 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
               "dump-guest-core",
               "disable-ksm", /* 112 */
               "virtio-net-pci.__com_redhat_macvtap_compat", /* RHEL-specific */
+               /* RHEL-only for now; the name 'drive-reopen' is
+                * essential for XML compatibility, even though the
+                * upstream command was renamed
+                * 'block-job-complete'.  */
+               "drive-mirror",
+               "drive-reopen",
     );
 
 struct _qemuCaps {
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 1f523ac..e03be83 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -151,6 +151,16 @@ enum qemuCapsFlags {
     QEMU_CAPS_DISABLE_KSM           , /* Is '-redhat-disable-KSM' available? */
     QEMU_CAPS_VIRTIO_NET_MACVTAP_COMPAT, /* virtio-net-pci.__com_redhat_macvtap_compat */
 
+    /* RHEL-only: these two caps must exist in order to upgrade
+     * running domains from 6.3 to prerelease 6.4 libvirt.  They are
+     * unused in this particular build, but will be used once we
+     * rebase to upstream qemu and libvirt drive-mirror support.  */
+    QEMU_CAPS_DRIVE_MIRROR, /* 6.3 __com.redhat.drive-mirror, will hit
+                             * upstream qemu 1.2 as drive-mirror */
+    QEMU_CAPS_DRIVE_REOPEN, /* 6.3 __com.redhat.drive-reopen, will hit
+                             * upstream qemu 1.2 as
+                             * block-job-complete */
+
     QEMU_CAPS_LAST,                   /* this must always be the last item */
 };
 
-- 
1.7.11.4

openSUSE Build Service is sponsored by