[pve-devel] r6372 - in pve-storage/pve2: . PVE

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Jul 28 06:31:45 CEST 2011


Author: dietmar
Date: 2011-07-28 06:31:44 +0200 (Thu, 28 Jul 2011)
New Revision: 6372

Modified:
   pve-storage/pve2/ChangeLog
   pve-storage/pve2/PVE/Storage.pm
Log:
	* PVE/Storage.pm (vdisk_alloc): use run_command() in order to get
	better error messages.



Modified: pve-storage/pve2/ChangeLog
===================================================================
--- pve-storage/pve2/ChangeLog	2011-07-28 04:29:17 UTC (rev 6371)
+++ pve-storage/pve2/ChangeLog	2011-07-28 04:31:44 UTC (rev 6372)
@@ -1,3 +1,8 @@
+2011-07-28  Proxmox Support Team  <support at proxmox.com>
+
+	* PVE/Storage.pm (vdisk_alloc): use run_command() in order to get
+	better error messages.
+
 2011-07-27  Proxmox Support Team  <support at proxmox.com>
 
 	* PVE/API2/Storage/Config.pm (create): add option 'base' 

Modified: pve-storage/pve2/PVE/Storage.pm
===================================================================
--- pve-storage/pve2/PVE/Storage.pm	2011-07-28 04:29:17 UTC (rev 6371)
+++ pve-storage/pve2/PVE/Storage.pm	2011-07-28 04:31:44 UTC (rev 6372)
@@ -1218,11 +1218,8 @@
 
 	    die "disk image '$path' already exists\n" if -f $path;
 
-	    if (system ("/usr/bin/qemu-img create -f $fmt '$path' ${size}K") != 0) {
-		my $msg = "unable to create image - $!\n";
-		unlink $path;
-		die $msg;
-	    }
+	    run_command("/usr/bin/qemu-img create -f $fmt '$path' ${size}K", 
+			errmsg => "unable to create image");
 
 	    return "$storeid:$vmid/$name";
 



More information about the pve-devel mailing list