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>
}
sub volume_snapshot {
- my ($cfg, $volid, $snap, $running) = @_;
+ my ($cfg, $volid, $snap) = @_;
my ($storeid, $volname) = parse_volume_id($volid, 1);
if ($storeid) {
my $scfg = storage_config($cfg, $storeid);
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
- return $plugin->volume_snapshot($scfg, $storeid, $volname, $snap, $running);
+ return $plugin->volume_snapshot($scfg, $storeid, $volname, $snap);
} elsif ($volid =~ m|^(/.+)$| && -e $volid) {
die "snapshot file/device '$volid' is not possible\n";
} else {
}
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";
}
}
sub volume_snapshot {
- my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
+ my ($class, $scfg, $storeid, $volname, $snap) = @_;
die "lvm snapshot is not implemented";
}
}
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];
}
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);
}
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);
}
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");
}