diff options
author | Olivier Blin <oblin@mandriva.com> | 2010-09-17 15:56:03 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2010-09-17 15:56:03 +0000 |
commit | 9c236aadb15a34461d7ddad686d9759715f5626d (patch) | |
tree | 57484b17352b296cc4466816f38065920a115645 | |
parent | 52b51fd431bd2d34608fcb7d1c0e66616b494f01 (diff) | |
download | drakiso-9c236aadb15a34461d7ddad686d9759715f5626d.tar drakiso-9c236aadb15a34461d7ddad686d9759715f5626d.tar.gz drakiso-9c236aadb15a34461d7ddad686d9759715f5626d.tar.bz2 drakiso-9c236aadb15a34461d7ddad686d9759715f5626d.tar.xz drakiso-9c236aadb15a34461d7ddad686d9759715f5626d.zip |
do not build vm image by default for masters, do it only if vm_type
settings is set (check qemu-img for valid types, like qcow2, vmdk, ...)
-rwxr-xr-x | draklive | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1239,6 +1239,12 @@ sub create_image { sub create_vm_image { my ($live) = @_; + my $vm_type = $live->{settings}{vm_type}; + if (!$vm_type) { + warn "no vm_type has been set in settings, skipping"; + return; + } + if (!$live->{media}->get_media_setting('image')) { warn "not implemented yet\n"; return; @@ -1250,9 +1256,9 @@ sub create_vm_image { } my $vm_image = $master; - $vm_image =~ s/.img$/.vmdk/; + $vm_image =~ s/.img$/.$vm_type/; - run_("qemu-img", "convert", "-O", "vmdk", $master, $vm_image); + run_("qemu-img", "convert", "-O", $vm_type, $master, $vm_image); } sub get_rescue_files { |