From: Michal Privoznik Date: Thu, 24 Jan 2019 08:58:38 +0000 (+0100) Subject: qemu: Assume migration with a network disk migration is safe X-Git-Tag: v5.1.0-rc1~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86caae39537969ff87ce18d3e6bc1bb18181f61b;p=thirdparty%2Flibvirt.git qemu: Assume migration with a network disk migration is safe If a domain has a disk that is type='network' we require specific cache mode to allow migration with it (either 'directsync' or 'none'). This doesn't make much sense since network disks are supposed to be safe to migrate by default. At the same time, we should be checking for the actual source type, not apparent type set in the domain XML. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 52aa665640..1433b2c2f3 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1236,7 +1236,7 @@ qemuMigrationSrcIsSafe(virDomainDefPtr def, continue; /* However, disks on local FS (e.g. ext4) are not safe. */ - if (virDomainDiskGetType(disk) == VIR_STORAGE_TYPE_FILE) { + if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_FILE) { if ((rc = virFileIsSharedFS(src)) < 0) { return false; } else if (rc == 0) { @@ -1248,8 +1248,8 @@ qemuMigrationSrcIsSafe(virDomainDefPtr def, return false; else if (rc == 1) continue; - } else if (disk->src->type == VIR_STORAGE_TYPE_NETWORK && - disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_RBD) { + } else if (virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_NETWORK) { + /* But network disks are safe again. */ continue; }