[pve-devel] [PATCH 1/2] activate_volume before generate kvm command line
Alexandre DERUMIER
aderumier at odiso.com
Tue May 29 10:01:12 CEST 2012
where is vm_commandline used ?
I don't find any part of code using it
"
grep -r vm_commandline /usr/share/perl5/PVE/
/usr/share/perl5/PVE/QemuServer.pm:sub vm_commandline {
"
----- Mail original -----
De: "Dietmar Maurer" <dietmar at proxmox.com>
À: "Alexandre Derumier" <aderumier at odiso.com>, pve-devel at pve.proxmox.com
Envoyé: Mardi 29 Mai 2012 09:46:42
Objet: RE: [pve-devel] [PATCH 1/2] activate_volume before generate kvm command line
config_to_command() is also used in vm_commandline(), so you also need to activate storage there?
Then it is maybe better to activate inside config_to_command()? This is an unexpected side effect, so we should make config_to_command() a private method. Or do we use that somewhere else?
> -----Original Message-----
> From: pve-devel-bounces at pve.proxmox.com [mailto:pve-devel-
> bounces at pve.proxmox.com] On Behalf Of Alexandre Derumier
> Sent: Dienstag, 29. Mai 2012 08:12
> To: pve-devel at pve.proxmox.com
> Subject: [pve-devel] [PATCH 1/2] activate_volume before generate kvm
> command line
>
> 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
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
--
--
Alexandre D erumier
Ingénieur Système
Fixe : 03 20 68 88 90
Fax : 03 20 68 90 81
45 Bvd du Général Leclerc 59100 Roubaix - France
12 rue Marivaux 75002 Paris - France
More information about the pve-devel
mailing list