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

Alexandre Derumier aderumier at odiso.com
Mon Oct 17 12:20:45 CEST 2016


changelog : check running qemu binary version

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 e4c385f..f42b733 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5932,8 +5932,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 = get_running_qemu_version ($vmid);
+	    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