Commit 1f2ff4a6 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Don't create new Void image if already exists

parent cdd7679e
......@@ -26,13 +26,17 @@ sub BUILD {
my $self = shift;
my $args = $_[0];
mkdir $DIR_TMP or die "$! when mkdir $DIR_TMP"
if ! -e $DIR_TMP;
return if $args->{id_base};
my $file_img = "$DIR_TMP/".$self->name.".img";
return if -e $file_img;
$self->add_volume(name => 'void-diska' , size => $args->{disk}
, path => "$DIR_TMP/".$self->name.".img");
, path => $file_img);
$self->_set_default_info();
$self->set_memory($args->{memory}) if $args->{memory};
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment