From 6bf56298667004d014178e8e1697dde380efc4b8 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 16 Jul 2012 06:45:13 +0200 Subject: [PATCH] fix offline migration bug Alway pass volname and storeid to plugin->path() --- Makefile | 2 +- PVE/Storage.pm | 10 +++++----- PVE/Storage/Plugin.pm | 2 +- changelog.Debian | 8 ++++++++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 86da5a6..e155791 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ RELEASE=2.1 VERSION=2.0 PACKAGE=libpve-storage-perl -PKGREL=19 +PKGREL=20 DESTDIR= PREFIX=/usr diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 3937c0a..8363672 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -243,15 +243,15 @@ sub path { sub storage_migrate { 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; - my $scfg = storage_config ($cfg, $storeid); + my $scfg = storage_config($cfg, $storeid); # no need to migrate shared content 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}"; @@ -269,8 +269,8 @@ sub storage_migrate { my $src_plugin = PVE::Storage::Plugin->lookup($scfg->{type}); my $dst_plugin = PVE::Storage::Plugin->lookup($tcfg->{type}); - my $src = $src_plugin->path($scfg, $volid); - my $dst = $dst_plugin->path($tcfg, $target_volid); + my $src = $src_plugin->path($scfg, $volname, $storeid); + my $dst = $dst_plugin->path($tcfg, $target_volname, $target_storeid); my $dirname = dirname($dst); diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index 88d98bb..4eedabf 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -384,7 +384,7 @@ sub get_subdir { } sub path { - my ($class, $scfg, $volname) = @_; + my ($class, $scfg, $volname, $storeid) = @_; my ($vtype, $name, $vmid) = $class->parse_volname($volname); diff --git a/changelog.Debian b/changelog.Debian index 596b0a3..8026be3 100644 --- a/changelog.Debian +++ b/changelog.Debian @@ -1,3 +1,11 @@ +libpve-storage-perl (2.0-20) unstable; urgency=low + + * include rbd plugin + + * fix offline migration bug + + -- Proxmox Support Team Mon, 16 Jul 2012 06:44:54 +0200 + libpve-storage-perl (2.0-19) unstable; urgency=low * cleanup: new plugin architecture