fix offline migration bug
Alway pass volname and storeid to plugin->path()
This commit is contained in:
2
Makefile
2
Makefile
@ -2,7 +2,7 @@ RELEASE=2.1
|
|||||||
|
|
||||||
VERSION=2.0
|
VERSION=2.0
|
||||||
PACKAGE=libpve-storage-perl
|
PACKAGE=libpve-storage-perl
|
||||||
PKGREL=19
|
PKGREL=20
|
||||||
|
|
||||||
DESTDIR=
|
DESTDIR=
|
||||||
PREFIX=/usr
|
PREFIX=/usr
|
||||||
|
|||||||
@ -243,15 +243,15 @@ sub path {
|
|||||||
sub storage_migrate {
|
sub storage_migrate {
|
||||||
my ($cfg, $volid, $target_host, $target_storeid, $target_volname) = @_;
|
my ($cfg, $volid, $target_host, $target_storeid, $target_volname) = @_;
|
||||||
|
|
||||||
my ($storeid, $volname) = parse_volume_id ($volid);
|
my ($storeid, $volname) = parse_volume_id($volid);
|
||||||
$target_volname = $volname if !$target_volname;
|
$target_volname = $volname if !$target_volname;
|
||||||
|
|
||||||
my $scfg = storage_config ($cfg, $storeid);
|
my $scfg = storage_config($cfg, $storeid);
|
||||||
|
|
||||||
# no need to migrate shared content
|
# no need to migrate shared content
|
||||||
return if $storeid eq $target_storeid && $scfg->{shared};
|
return if $storeid eq $target_storeid && $scfg->{shared};
|
||||||
|
|
||||||
my $tcfg = storage_config ($cfg, $target_storeid);
|
my $tcfg = storage_config($cfg, $target_storeid);
|
||||||
|
|
||||||
my $target_volid = "${target_storeid}:${target_volname}";
|
my $target_volid = "${target_storeid}:${target_volname}";
|
||||||
|
|
||||||
@ -269,8 +269,8 @@ sub storage_migrate {
|
|||||||
|
|
||||||
my $src_plugin = PVE::Storage::Plugin->lookup($scfg->{type});
|
my $src_plugin = PVE::Storage::Plugin->lookup($scfg->{type});
|
||||||
my $dst_plugin = PVE::Storage::Plugin->lookup($tcfg->{type});
|
my $dst_plugin = PVE::Storage::Plugin->lookup($tcfg->{type});
|
||||||
my $src = $src_plugin->path($scfg, $volid);
|
my $src = $src_plugin->path($scfg, $volname, $storeid);
|
||||||
my $dst = $dst_plugin->path($tcfg, $target_volid);
|
my $dst = $dst_plugin->path($tcfg, $target_volname, $target_storeid);
|
||||||
|
|
||||||
my $dirname = dirname($dst);
|
my $dirname = dirname($dst);
|
||||||
|
|
||||||
|
|||||||
@ -384,7 +384,7 @@ sub get_subdir {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub path {
|
sub path {
|
||||||
my ($class, $scfg, $volname) = @_;
|
my ($class, $scfg, $volname, $storeid) = @_;
|
||||||
|
|
||||||
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
my ($vtype, $name, $vmid) = $class->parse_volname($volname);
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,11 @@
|
|||||||
|
libpve-storage-perl (2.0-20) unstable; urgency=low
|
||||||
|
|
||||||
|
* include rbd plugin
|
||||||
|
|
||||||
|
* fix offline migration bug
|
||||||
|
|
||||||
|
-- Proxmox Support Team <support@proxmox.com> Mon, 16 Jul 2012 06:44:54 +0200
|
||||||
|
|
||||||
libpve-storage-perl (2.0-19) unstable; urgency=low
|
libpve-storage-perl (2.0-19) unstable; urgency=low
|
||||||
|
|
||||||
* cleanup: new plugin architecture
|
* cleanup: new plugin architecture
|
||||||
|
|||||||
Reference in New Issue
Block a user