[pve-devel] [PATCH] enable drive-mirror with iothread for qemu 2.7

Alexandre Derumier aderumier at odiso.com
Thu Oct 13 12:00:42 CEST 2016


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 05edd7a..ec8df94 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5933,8 +5933,11 @@ sub clone_disk {
 	if (!$running || $snapname) {
 	    qemu_img_convert($drive->{file}, $newvolid, $size, $snapname, $sparseinit);
 	} else {
-	    #qemu 2.6
-	    die "drive-mirror is not working currently when iothread is enabled" if $drive->{iothread};
+
+	    my $kvmver = kvm_user_version();
+	    if (!qemu_machine_feature_enabled (undef, $kvmver, 2, 7)) {
+		die "drive-mirror with iothread only works since qemu 2.7" if $drive->{iothread};
+	    }
 
 	    qemu_drive_mirror($vmid, $drivename, $newvolid, $newvmid, $sparseinit);
 	}
-- 
2.1.4




More information about the pve-devel mailing list