mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: migration: Reject migration of an empty disk
If you specify disks to migrate it would be possible to select an empty drive for migration. Reject such config.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user