[libvirt] [PATCH] qemu: reject rather than hang on blockcommit of active layer

Eric Blake eblake at redhat.com
Tue May 27 23:14:52 UTC 2014


qemu 2.0 added the ability to commit the active layer, but slightly
differently than what libvirt had been anticipating in its
implementation of the virDomainBlockCommit call.  As a result, if
you attempt to do a 'virsh blockcommit $dom vda', qemu gets into a
state where it is waiting on libvirt to end the job, while libvirt
is waiting on qemu to end the job, and the guest is effectively
hung with regards to further commands for that block device.

I have patches coming down the pipeline that will add full support
for blockcommit of the active layer when coupled with qemu 2.0 or
later; but they depend on Peter's improvements to block job handling
and form enough of a new feature that they are not ready for
inclusion in the 1.2.5 release.  So for now, just reject the
attempt, rather than letting the user get stuck.  This is no worse
than the behavior of qemu 1.7 rejecting the job.

* src/qemu/qemu_driver.c (qemuDomainBlockCommit): Reject active
commit.

Signed-off-by: Eric Blake <eblake at redhat.com>
---

This patch should be committed before the 1.2.5 release, while
I continue to polish my full series for active commit support
for inclusion after the release.

 src/qemu/qemu_driver.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2b852eb..f008763 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15461,6 +15461,15 @@ qemuDomainBlockCommit(virDomainPtr dom,
                                                      &top_parent)))
         goto endjob;

+    /* FIXME: qemu 2.0 supports active commit, but as a two-stage
+     * process; qemu 2.1 is further improving active commit. We need
+     * to start support it in libvirt. */
+    if (topSource == &disk->src) {
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                       _("committing the active layer not supported yet"));
+        goto endjob;
+    }
+
     if (!topSource->backingStore) {
         virReportError(VIR_ERR_INVALID_ARG,
                        _("top '%s' in chain for '%s' has no backing file"),
-- 
1.9.3




More information about the libvir-list mailing list