[pve-devel] [PATCH 1/2] activate_volume before generate kvm command line

Alexandre Derumier aderumier at odiso.com
Tue May 29 08:12:09 CEST 2012


I need this for my nexenta plugin, guest config have nexentavolume in drive option,
I need to translate it to /dev/disk/... , so volume must be activated before generating command line.

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index ad8dff1..8a56b04 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2618,7 +2618,10 @@ sub vm_start {
 
 	my $defaults = load_defaults();
 
-	my ($cmd, $vollist) = config_to_command($storecfg, $vmid, $conf, $defaults, $migrate_uri);
+        my $vollist = get_vm_volumes($conf);
+        PVE::Storage::activate_volumes($storecfg, $vollist);
+
+	my ($cmd) = config_to_command($storecfg, $vmid, $conf, $defaults, $migrate_uri);
 	# host pci devices
         for (my $i = 0; $i < $MAX_HOSTPCI_DEVICES; $i++)  {
           my $d = parse_hostpci($conf->{"hostpci$i"});
@@ -2630,8 +2633,6 @@ sub vm_start {
           die "can't reset pci device '$d->{pciid}'\n" if !pci_dev_reset($info);
         }
 
-	PVE::Storage::activate_volumes($storecfg, $vollist);
-
 	eval  { run_command($cmd, timeout => $migrate_uri ? undef : 30); };
 	my $err = $@;
 	die "start failed: $err" if $err;
-- 
1.7.2.5




More information about the pve-devel mailing list