From d7810bc1239ffc36a3389a95fe2b92057599f120 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 2 Apr 2012 10:52:05 +0200 Subject: [PATCH 1/1] fix bug #134: allow to pass file names to qmrestore and 'qm set' --- Makefile | 2 +- PVE/API2/Qemu.pm | 10 +++++++--- changelog.Debian | 6 ++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9995b939..52885166 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ RELEASE=2.0 VERSION=2.0 PACKAGE=qemu-server -PKGREL=34 +PKGREL=35 DESTDIR= PREFIX=/usr diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 91d9439e..50403ffd 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -86,7 +86,8 @@ my $create_disks = sub { $res->{$ds} = PVE::QemuServer::print_drive($vmid, $disk); } else { my $path = $rpcenv->check_volume_access($authuser, $storecfg, $vmid, $volid); - PVE::Storage::activate_volumes($storecfg, [ $volid ]); + PVE::Storage::activate_volumes($storecfg, [ $volid ]) + if PVE::Storage::parse_volume_id ($volid, 1); die "image '$path' does not exists\n" if (!(-f $path || -b $path)); $res->{$ds} = $settings->{$ds}; } @@ -298,10 +299,13 @@ __PACKAGE__->register_method({ if ($archive eq '-') { die "pipe requires cli environment\n" - && $rpcenv->{type} ne 'cli'; + if $rpcenv->{type} ne 'cli'; } else { my $path = $rpcenv->check_volume_access($authuser, $storecfg, $vmid, $archive); - PVE::Storage::activate_volumes($storecfg, [ $archive ]); + + PVE::Storage::activate_volumes($storecfg, [ $archive ]) + if PVE::Storage::parse_volume_id ($archive, 1); + die "can't find archive file '$archive'\n" if !($path && -f $path); $archive = $path; } diff --git a/changelog.Debian b/changelog.Debian index ad909db1..a4e4f3c2 100644 --- a/changelog.Debian +++ b/changelog.Debian @@ -1,3 +1,9 @@ +qemu-server (2.0-35) unstable; urgency=low + + * fix bug #134: allow to pass file names to qmrestore and 'qm set' + + -- Proxmox Support Team Mon, 02 Apr 2012 10:51:41 +0200 + qemu-server (2.0-34) unstable; urgency=low * fix bug #12: check storage availability early (migrate) -- 2.39.5