mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 15:15:25 +00: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:
parent
03766247ae
commit
5a990e0bf3
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user