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

@ -421,9 +421,9 @@ sub deactivate_storage {
}
sub activate_volume {
my ($class, $storeid, $scfg, $volname, $cache) = @_;
my ($class, $storeid, $scfg, $volname, $snapname, $cache) = @_;
#fix me lvmchange is not provided on
my $path = $class->path($scfg, $volname);
my $path = $class->path($scfg, $volname, $snapname);
my $lvm_activate_mode = 'ey';
@ -432,9 +432,9 @@ sub activate_volume {
}
sub deactivate_volume {
my ($class, $storeid, $scfg, $volname, $cache) = @_;
my ($class, $storeid, $scfg, $volname, $snapname, $cache) = @_;
my $path = $class->path($scfg, $volname);
my $path = $class->path($scfg, $volname, $snapname);
return if ! -b $path;
my $cmd = ['/sbin/lvchange', '-aln', $path];