[PATCH 5/5] qemu: migration: Reject migration of an empty disk

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

 



If you specify disks to migrate it would be possible to select an empty
drive for migration. Reject such config.
---
 src/qemu/qemu_migration.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 46f82ab33..09adb0484 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -515,9 +515,10 @@ qemuMigrationStartNBDServer(virQEMUDriverPtr driver,
         if (!qemuMigrateDisk(disk, nmigrate_disks, migrate_disks))
             continue;

-        if (disk->src->readonly) {
+        if (disk->src->readonly || virStorageSourceIsEmpty(disk->src)) {
             virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
-                           _("Cannot migrate read-only disk %s"), disk->dst);
+                           _("Cannot migrate empty or read-only disk %s"),
+                           disk->dst);
             goto cleanup;
         }

-- 
2.12.2

--
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]
  Powered by Linux