[pve-devel] [PATCH qemu-server 1/4] add switch to skip creation of target image for qemu-img
Timo Grodzinski
t.grodzinski at profihost.ag
Mon Feb 15 14:33:46 CET 2016
Signed-off-by: Timo Grodzinski <t.grodzinski at profihost.ag>
---
PVE/QemuServer.pm | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index bfce953..a130596 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6368,7 +6368,7 @@ sub is_template {
}
sub qemu_img_convert {
- my ($src_volid, $dst_volid, $size, $snapname) = @_;
+ my ($src_volid, $dst_volid, $size, $snapname, $dont_create_target) = @_;
my $storecfg = PVE::Storage::config();
my ($src_storeid, $src_volname) = PVE::Storage::parse_volume_id($src_volid, 1);
@@ -6388,9 +6388,13 @@ sub qemu_img_convert {
my $dst_path = PVE::Storage::path($storecfg, $dst_volid);
my $cmd = [];
- push @$cmd, '/usr/bin/qemu-img', 'convert', '-t', 'writeback', '-p', '-n';
+ push @$cmd, '/usr/bin/qemu-img', 'convert', '-t', 'writeback', '-p';
+ push @$cmd, '-n' if $params{dont_create_target};
push @$cmd, '-s', $snapname if($snapname && $src_format eq "qcow2");
- push @$cmd, '-f', $src_format, '-O', $dst_format, $src_path, $dst_path;
+ push @$cmd, '-f', $src_format if !$params{auto_src_format};
+ push @$cmd, '-O', $dst_format, $src_path, $dst_path;
+
+ print "running '" . PVE::Tools::cmd2string( $cmd ) . "'\n" if $params{verbose};
my $parser = sub {
my $line = shift;
--
2.1.4
More information about the pve-devel
mailing list