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

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]