[PATCH 4/4] virsh: doMigrate: Require --copy-storage-(all|inc) with --migrate-disks

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

 



Users need to enable non-shared-storage migration, otherwise the disks
specified via '--migrate-disks' will be ignored.

Add an error message to inform the users of their wrong config.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tools/virsh-domain.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 84bf62057b..e0776c991f 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -11204,6 +11204,11 @@ doMigrate(void *opaque)
     if (opt) {
         g_autofree char **val = NULL;

+        if (!(flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC))) {
+            vshError(ctl, "'--migrate-disks' requires one of '--copy-storage-all', '--copy-storage-inc'");
+            goto out;
+        }
+
         val = g_strsplit(opt, ",", 0);

         if (virTypedParamsAddStringList(&params,
-- 
2.41.0




[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]

  Powered by Linux