if ($fmt eq 'subvol') {
# only allow this if size = 0, so that user knows what he is doing
die "storage does not support subvol quotas\n" if $size != 0;
-
+
my $old_umask = umask(0022);
my $err;
mkdir($path) or $err = "unable to create subvol '$path' - $!\n";
my $cmd = ['/usr/bin/qemu-img', 'create'];
push @$cmd, '-o', 'preallocation=metadata' if $fmt eq 'qcow2';
-
+
push @$cmd, '-f', $fmt, $path, "${size}K";
eval { run_command($cmd, errmsg => "unable to create image"); };
die "$@";
}
}
-
+
return "$vmid/$name";
}
# all images from a guest got deleted
my $dir = dirname($path);
rmdir($dir);
-
+
return undef;
}
if (-d $filename) {
return wantarray ? (0, 'subvol', 0, undef) : 1;
}
-
+
my $cmd = ['/usr/bin/qemu-img', 'info', $filename];
my $format;
}
sub volume_rollback_is_possible {
- my ($class, $scfg, $storeid, $volname, $snap) = @_;
+ my ($class, $scfg, $storeid, $volname, $snap) = @_;
- return 1;
+ return 1;
}
sub volume_snapshot_rollback {