remove running from Storage and check it in QemuServer
It is better to check if a VM is running in QemuServer then in Storage. for the Storage there is no difference if it is running or not. Signed-off-by: Wolfgang Link <w.link@proxmox.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
1ccae4490e
commit
f5640e7d3b
@ -205,7 +205,7 @@ sub volume_resize {
|
||||
}
|
||||
|
||||
sub volume_snapshot {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
|
||||
my ($class, $scfg, $storeid, $volname, $snap) = @_;
|
||||
die "volume snapshot is not possible on iscsi device";
|
||||
}
|
||||
|
||||
|
||||
@ -456,7 +456,7 @@ sub volume_resize {
|
||||
}
|
||||
|
||||
sub volume_snapshot {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
|
||||
my ($class, $scfg, $storeid, $volname, $snap) = @_;
|
||||
|
||||
die "lvm snapshot is not implemented";
|
||||
}
|
||||
|
||||
@ -641,12 +641,10 @@ sub volume_resize {
|
||||
}
|
||||
|
||||
sub volume_snapshot {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
|
||||
my ($class, $scfg, $storeid, $volname, $snap) = @_;
|
||||
|
||||
die "can't snapshot this image format\n" if $volname !~ m/\.(qcow2|qed)$/;
|
||||
|
||||
return 1 if $running;
|
||||
|
||||
my $path = $class->filesystem_path($scfg, $volname);
|
||||
|
||||
my $cmd = ['/usr/bin/qemu-img', 'snapshot','-c', $snap, $path];
|
||||
|
||||
@ -510,9 +510,7 @@ sub volume_resize {
|
||||
}
|
||||
|
||||
sub volume_snapshot {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
|
||||
|
||||
return 1 if $running;
|
||||
my ($class, $scfg, $storeid, $volname, $snap) = @_;
|
||||
|
||||
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
||||
|
||||
|
||||
@ -389,9 +389,7 @@ sub volume_resize {
|
||||
}
|
||||
|
||||
sub volume_snapshot {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
|
||||
|
||||
return 1 if $running;
|
||||
my ($class, $scfg, $storeid, $volname, $snap) = @_;
|
||||
|
||||
my ($vtype, $name, $vmid, $basename, $basevmid, $isBase) =
|
||||
$class->parse_volname($volname);
|
||||
|
||||
@ -446,7 +446,7 @@ sub volume_size_info {
|
||||
}
|
||||
|
||||
sub volume_snapshot {
|
||||
my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
|
||||
my ($class, $scfg, $storeid, $volname, $snap) = @_;
|
||||
|
||||
$class->zfs_request($scfg, undef, 'snapshot', "$scfg->{pool}/$volname\@$snap");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user