[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]