On Tue, Sep 20, 2016 at 09:40:22 -0400, Corey S. McQuay wrote:
Currently Libvirt allows attempts to migrate read only disks. Qemu
cannot handle this as read only
disks cannot be written to on the destination system. The end result is a cryptic error
message
and a failed migration.
This is not necessarily true. Read only disks can sometimes be in fact
backed by storage that is writable and it's desired to be migrated.
I think you want to specify which storage to migrate using the
VIR_MIGRATE_PARAM_MIGRATE_DISKS migration parameter for
virDomainMigrate3.
http://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrate3
http://libvirt.org/html/libvirt-libvirt-domain.html#VIR_MIGRATE_PARAM_MIG...
Virsh also implements support for that flag.
This patch causes migration to fail earlier and provides a meaningful
error message stating that
migrating read only disks is not supported.
Signed-off-by: Corey S. McQuay <csmcquay(a)linux.vnet.ibm.com>
Reviewed-by: Jason J. Herne <jjherne(a)linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
---
src/qemu/qemu_migration.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index e451ef6..011f349 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2157,6 +2157,13 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver,
if (!qemuMigrateDisk(disk, nmigrate_disks, migrate_disks))
continue;
+ if (disk->src->readonly) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("Cannot migrate read-only disk %s"),
+ disk->dst);
+ goto cleanup;
+ }
NACK this would break the above use case. You want to specify explicitly
which storage to migrate using the above described API.
Peter