[pve-devel] r5190 - in qemu-server/pve2: . PVE/VZDump

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Sep 21 11:10:37 CEST 2010


Author: dietmar
Date: 2010-09-21 09:10:37 +0000 (Tue, 21 Sep 2010)
New Revision: 5190

Modified:
   qemu-server/pve2/ChangeLog
   qemu-server/pve2/PVE/VZDump/QemuServer.pm
Log:
	* PVE/VZDump/QemuServer.pm (prepare): remove PVE::QemuServer->new() call.


Modified: qemu-server/pve2/ChangeLog
===================================================================
--- qemu-server/pve2/ChangeLog	2010-09-20 14:15:51 UTC (rev 5189)
+++ qemu-server/pve2/ChangeLog	2010-09-21 09:10:37 UTC (rev 5190)
@@ -1,3 +1,7 @@
+2010-09-21  Proxmox Support Team  <support at proxmox.com>
+
+	* PVE/VZDump/QemuServer.pm (prepare): remove PVE::QemuServer->new() call.
+
 2010-09-17  Proxmox Support Team  <support at proxmox.com>
 
 	* PVE/API2/Qemu/Config.pm: impl. unlink/delete for disks.

Modified: qemu-server/pve2/PVE/VZDump/QemuServer.pm
===================================================================
--- qemu-server/pve2/PVE/VZDump/QemuServer.pm	2010-09-20 14:15:51 UTC (rev 5189)
+++ qemu-server/pve2/PVE/VZDump/QemuServer.pm	2010-09-21 09:10:37 UTC (rev 5190)
@@ -25,6 +25,7 @@
 use File::Path;
 use File::Basename;
 use PVE::VZDump;
+use PVE::INotify qw(read_file);
 use PVE::Storage;
 use PVE::QemuServer;
 use Sys::Hostname;
@@ -39,9 +40,8 @@
 
     my $self = bless { vzdump => $vzdump };
 
-    $self->{qm} = PVE::QemuServer->new();
-
     $self->{vmlist} = PVE::QemuServer::vzlist();
+    $self->{storecfg} = read_file('storagecfg');
 
     return $self;
 };
@@ -62,12 +62,10 @@
 
     $task->{disks} = [];
 
-    my $conf = $self->{vmlist}->{$vmid} = $self->{qm}->load_config ($vmid);
+    my $conf = $self->{vmlist}->{$vmid} = PVE::QemuServer::load_config ($vmid);
 
     $task->{hostname} = $conf->{name};
 
-    my $di = $conf->{diskinfo};
-
     my $lvmmap = PVE::VZDump::get_lvm_mapping();
 
     my $hostname = hostname(); 
@@ -78,22 +76,24 @@
 
     my $snapshot_count = 0;
 
-    foreach my $ds (sort keys %$di) {
-	next if PVE::QemuServer::drive_is_cdrom ($di->{$ds});
+    foreach my $ds (keys %$conf) {
+	next if ! PVE::QemuServer::valid_drivename($ds); # only drives
 
-	my $volid = $di->{$ds}->{file};
+	my $drive = PVE::QemuServer::parse_drive ($ds, $conf->{$ds});
+	next if PVE::QemuServer::drive_is_cdrom ($drive);
 
+	my $volid = $drive->{file};
+
 	my $path;
 
 	my ($storeid, $volname) = PVE::Storage::parse_volume_id ($volid, 1);
 	if ($storeid) {
-	    $path = PVE::Storage::path ($self->{qm}->{storecfg}, $volid);
+	    PVE::Storage::activate_storage ($self->{storecfg}, $storeid);
+	    $path = PVE::Storage::path ($self->{storecfg}, $volid);
 	} else {
 	    $path = $volid;
 	}
 
-	$self->{qm}->activate_volumes ($conf);
-
 	die "no such volume '$volid'\n" if ! -e $path;
 
 	my $diskinfo = { path => $path , volid => $volid, storeid => $storeid, 
@@ -238,7 +238,7 @@
     my ($storeid, $volname) = PVE::Storage::parse_volume_id ($volid, 1);
     if ($storeid) {
 
-	my $scfg = PVE::Storage::storage_config ($self->{qm}->{storecfg}, $storeid);
+	my $scfg = PVE::Storage::storage_config ($self->{storecfg}, $storeid);
 
 	# lock shared storage
 	return PVE::Storage::cluster_lock_storage ($storeid, $scfg->{shared}, undef, sub {
@@ -266,7 +266,7 @@
 	my ($storeid, $volname) = PVE::Storage::parse_volume_id ($volid, 1);
 	if ($storeid) {
 
-	    my $scfg = PVE::Storage::storage_config ($self->{qm}->{storecfg}, $storeid);
+	    my $scfg = PVE::Storage::storage_config ($self->{storecfg}, $storeid);
 
 	    # lock shared storage
 	    return PVE::Storage::cluster_lock_storage ($storeid, $scfg->{shared}, undef, sub {




More information about the pve-devel mailing list