From: Alexandre Derumier Date: Thu, 6 Sep 2012 08:27:51 +0000 (+0200) Subject: storage : add volume_snapshot X-Git-Url: https://git.proxmox.com/?p=pve-storage.git;a=commitdiff_plain;h=db60719cde493e10de06a5b37cf3cbbd077338b3 storage : add volume_snapshot Signed-off-by: Alexandre Derumier --- diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 4afdf15..188db60 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -138,6 +138,21 @@ sub volume_resize { } } +sub volume_snapshot { + my ($cfg, $volid, $snap, $running) = @_; + + 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); + } elsif ($volid =~ m|^(/.+)$| && -e $volid) { + die "snapshot device is not possible"; + } else { + die "can't snapshot"; + } +} + sub get_image_dir { my ($cfg, $storeid, $vmid) = @_;