[pve-devel] [PATCH qemu-server] use PVE::Storage::config(), not cfs_read_file()

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Mar 25 14:01:36 CET 2016


---
 PVE/QemuServer.pm | 8 ++++----
 qmextract         | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 990d9a1..df9932c 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5321,7 +5321,7 @@ sub update_disksize {
 sub rescan {
     my ($vmid, $nolock) = @_;
 
-    my $cfg = PVE::Cluster::cfs_read_file("storage.cfg");
+    my $cfg = PVE::Storage::config();
 
     my $volid_hash = scan_volids($cfg, $vmid);
 
@@ -5460,7 +5460,7 @@ sub restore_vma_archive {
 		if !$devinfo->{$devname}->{virtdev};
 	}
 
-	my $cfg = cfs_read_file('storage.cfg');
+	my $cfg = PVE::Storage::config();
 
 	# create empty/temp config
 	if ($oldconf) {
@@ -5585,7 +5585,7 @@ sub restore_vma_archive {
 	push @$vollist, $volid if $volid;
     }
 
-    my $cfg = cfs_read_file('storage.cfg');
+    my $cfg = PVE::Storage::config();
     PVE::Storage::deactivate_volumes($cfg, $vollist);
 
     unlink $mapfifo;
@@ -5630,7 +5630,7 @@ sub restore_tar_archive {
 	    if $firstfile ne 'qemu-server.conf';
     }
 
-    my $storecfg = cfs_read_file('storage.cfg');
+    my $storecfg = PVE::Storage::config();
 
     # destroy existing data - keep empty config
     my $vmcfgfn = PVE::QemuConfig->config_file($vmid);
diff --git a/qmextract b/qmextract
index d6ee329..87d9e12 100755
--- a/qmextract
+++ b/qmextract
@@ -8,7 +8,7 @@ use IO::File;
 use PVE::INotify;
 use PVE::JSONSchema;
 use PVE::Tools;
-use PVE::Cluster qw(cfs_read_file);
+use PVE::Cluster;
 use PVE::RPCEnvironment;
 use PVE::QemuServer;
 
@@ -160,7 +160,7 @@ sub extract_archive {
 	    $storeid = $info->{storeid} || 'local';
 	}
 
-	my $cfg = cfs_read_file('storage.cfg');
+	my $cfg = PVE::Storage::config();
 	my $scfg = PVE::Storage::storage_config($cfg, $storeid);
 
 	my $alloc_size = int(($filesize + 1024 - 1)/1024);
-- 
2.1.4





More information about the pve-devel mailing list