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

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

 




On 04/07/2017 11:50 AM, Peter Krempa wrote:
> If you specify disks to migrate it would be possible to select an empty
> drive for migration. Reject such config.

because ...

> ---
>  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;

IOW: For disks that are not in our migrate_disk list and this is only
ever called when the flags VIR_MIGRATE_NON_SHARED_DISK |
VIR_MIGRATE_NON_SHARED_INC are set...

So to a degree the checks made in patch 3 make a bit more sense once
it's understood that there's this code.... Like I said - something
subtle in how this all "magically" works...

ACK for this though,

John

> 
> -        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;
>          }
> 

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