[pve-devel] r5212 - qemu-server/trunk

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Oct 5 12:31:55 CEST 2010


Author: dietmar
Date: 2010-10-05 10:31:55 +0000 (Tue, 05 Oct 2010)
New Revision: 5212

Modified:
   qemu-server/trunk/ChangeLog
   qemu-server/trunk/Makefile
   qemu-server/trunk/changelog.Debian
   qemu-server/trunk/qmrestore
Log:


Modified: qemu-server/trunk/ChangeLog
===================================================================
--- qemu-server/trunk/ChangeLog	2010-10-05 09:50:20 UTC (rev 5211)
+++ qemu-server/trunk/ChangeLog	2010-10-05 10:31:55 UTC (rev 5212)
@@ -1,3 +1,8 @@
+2010-10-05  Seth Lauzon <seth.lauzon at gmail.com>
+
+	* qmrestore (restore_qemu): new option --unique (create unique MAC
+	address on restore)
+
 2010-08-20  Proxmox Support Team  <support at proxmox.com>
 
 	* qmigrate (phase2): abort if migration status is 'failed'

Modified: qemu-server/trunk/Makefile
===================================================================
--- qemu-server/trunk/Makefile	2010-10-05 09:50:20 UTC (rev 5211)
+++ qemu-server/trunk/Makefile	2010-10-05 10:31:55 UTC (rev 5212)
@@ -2,7 +2,7 @@
 
 VERSION=1.1
 PACKAGE=qemu-server
-PKGREL=18
+PKGREL=19
 
 DESTDIR=
 PREFIX=/usr

Modified: qemu-server/trunk/changelog.Debian
===================================================================
--- qemu-server/trunk/changelog.Debian	2010-10-05 09:50:20 UTC (rev 5211)
+++ qemu-server/trunk/changelog.Debian	2010-10-05 10:31:55 UTC (rev 5212)
@@ -1,3 +1,10 @@
+qemu-server (1.1-19) unstable; urgency=low
+
+  * new qmrestore option '--unique' : create unique MAC address on
+    restore (many thanks to Seth)
+
+ -- Proxmox Support Team <support at proxmox.com>  Tue, 05 Oct 2010 12:29:20 +0200
+
 qemu-server (1.1-18) unstable; urgency=low
 
   * small bug fix im qmigrate

Modified: qemu-server/trunk/qmrestore
===================================================================
--- qemu-server/trunk/qmrestore	2010-10-05 09:50:20 UTC (rev 5211)
+++ qemu-server/trunk/qmrestore	2010-10-05 10:31:55 UTC (rev 5212)
@@ -32,7 +32,7 @@
 
 openlog ('vzdump', 'cons,pid', 'daemon');
 
-my @std_opts = ('extract', 'storage=s', 'info', 'prealloc');
+my @std_opts = ('extract', 'storage=s', 'info', 'prealloc', 'unique');
 
 sub print_usage {
     my $msg = shift;
@@ -295,14 +295,23 @@
 	    next if $line =~ m/^\#vzdump\#/;
 	    next if $line =~ m/^lock:/;
 
-	    $line =~ m/^((ide|scsi|virtio)\d+):(.*)$/;
-	    my $virtdev = $1;
-	    my $value = $2;
-	    if ($virtdev && $map->{$virtdev}) {
-		my $di = PVE::QemuServer::parse_drive ($virtdev, $value);
-		$di->{file} = $map->{$virtdev};
-		$value = PVE::QemuServer::print_drive ($vmid, $di);
-		print $outfd "$virtdev: $value\n";
+	    if (($line =~ m/^((vlan)\d+):(.*)$/) && ($opts->{unique})) {
+		my ($id,$ethcfg) = ($1,$3);
+		$ethcfg =~ s/^\s+//;
+		my ($model, $mac) = split(/\=/,$ethcfg);
+		my $printvlan = PVE::QemuServer::print_vlan (PVE::QemuServer::parse_vlan ($model));
+		print $outfd "$id: $printvlan\n";
+	    } elsif ($line =~ m/^((ide|scsi|virtio)\d+):(.*)$/) {
+		my $virtdev = $1;
+		my $value = $2;
+		if ($virtdev && $map->{$virtdev}) {
+		    my $di = PVE::QemuServer::parse_drive ($virtdev, $value);
+		    $di->{file} = $map->{$virtdev};
+		    $value = PVE::QemuServer::print_drive ($vmid, $di);
+		    print $outfd "$virtdev: $value\n";
+		} else {
+		    print $outfd $line;
+		}
 	    } else {
 		print $outfd $line;
 	    }
@@ -392,6 +401,8 @@
  --info                    read/verify archive and print relevant 
                            information (test run)
 
+ --unique		   assign a unique random ethernet address
+
  --storage <STORAGE_ID>    restore to storage <STORAGE_ID>
 
  --prealloc                never generate sparse files




More information about the pve-devel mailing list