extend functionality to (de)activate_volumes with snapshots

this extension provide the capability to activate or deactivate snapshot,
so we can use this e.g. for LXC backup in snapshot mode.
This commit is contained in:
Wolfgang Link
2015-09-18 11:57:07 +02:00
committed by Dietmar Maurer
parent 948a2dd0f1
commit 02e797b8e1
10 changed files with 59 additions and 23 deletions

View File

@ -831,7 +831,7 @@ sub deactivate_storage {
}
sub activate_volumes {
my ($cfg, $vollist) = @_;
my ($cfg, $vollist, $snapname) = @_;
return if !($vollist && scalar(@$vollist));
@ -849,12 +849,12 @@ sub activate_volumes {
my ($storeid, $volname) = parse_volume_id($volid);
my $scfg = storage_config($cfg, $storeid);
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
$plugin->activate_volume($storeid, $scfg, $volname, $cache);
$plugin->activate_volume($storeid, $scfg, $volname, $snapname, $cache);
}
}
sub deactivate_volumes {
my ($cfg, $vollist) = @_;
my ($cfg, $vollist, $snapname) = @_;
return if !($vollist && scalar(@$vollist));
@ -868,7 +868,7 @@ sub deactivate_volumes {
my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
eval {
$plugin->deactivate_volume($storeid, $scfg, $volname, $cache);
$plugin->deactivate_volume($storeid, $scfg, $volname, $snapname, $cache);
};
if (my $err = $@) {
warn $err;