Storage : add global volume_resize
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
6f714585f2
commit
7e6c05dc2c
@ -123,6 +123,21 @@ sub volume_size_info {
|
||||
}
|
||||
}
|
||||
|
||||
sub volume_resize {
|
||||
my ($cfg, $volid, $size, $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_resize($scfg, $storeid, $volname, $size, $running);
|
||||
} elsif ($volid =~ m|^(/.+)$| && -e $volid) {
|
||||
die "resize device is not possible";
|
||||
} else {
|
||||
die "can't resize";
|
||||
}
|
||||
}
|
||||
|
||||
sub get_image_dir {
|
||||
my ($cfg, $storeid, $vmid) = @_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user