[libvirt] [PATCHv6 10/8] blockjob: check for active vm before checking blockcopy bits

Eric Blake eblake at redhat.com
Fri Apr 27 19:45:57 UTC 2012


Similar to 8e532d3, but for block copy.

* src/qemu/qemu_driver.c (qemuDomainBlockCopy): Avoid misleading
error.
---

v6: new patch; although it might be worth squashing this into 6/8
when upstream qemu ever adds 'drive-mirror'

 src/qemu/qemu_driver.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index debb6d6..e3492f8 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12001,6 +12001,11 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *path,
                         _("no domain with matching uuid '%s'"), uuidstr);
         goto cleanup;
     }
+    if (!virDomainObjIsActive(vm)) {
+        qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                        _("domain is not running"));
+        goto cleanup;
+    }

     device = qemuDiskPathToAlias(vm, path, &idx);
     if (!device) {
-- 
1.7.7.6




More information about the libvir-list mailing list