[pve-devel] [PATCH] add pve-bridge-hotplug script

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Nov 10 09:16:03 CET 2015


I see, it's passed to qemu that way. Ah well, then I have another question: what
happens when you start, then migrate, then hotplug, then migrate again? Would
qemu complain about the parameters passed for the interfaces being different?

As for passing a parameter/env-var - there could still be a second script, which
would just be a wrapper to call the first script with a parameter.
Iow. pve-bridge-hotplug would just be something like:

#!/bin/sh
exec /var/lib/qemu-server/pve-bridge --hotplug

> On November 10, 2015 at 8:56 AM Alexandre DERUMIER <aderumier at odiso.com>
> wrote:
> 
> 
> >>Since the diff between pve-bridge and pve-bridge-hotplug is only a few 
> >>lines, I wonder if we should just make it a parameter for the script 
> >>(or a second env var, whichever seems better)? 
> >>Should I prepare a patch? 
> 
> I don't known how to pass param to script, I think we have tried in past, 
> and that why we use the env var. 
> And the env var is defined at qemu process start, I don't known if we can
> inject a
> new env var on the fly ?
> 
> 
> ----- Mail original -----
> De: "Wolfgang Bumiller" <w.bumiller at proxmox.com>
> À: "dietmar" <dietmar at proxmox.com>, "pve-devel" <pve-devel at pve.proxmox.com>
> Cc: "aderumier" <aderumier at odiso.com>
> Envoyé: Mardi 10 Novembre 2015 08:40:16
> Objet: Re: [pve-devel] [PATCH] add pve-bridge-hotplug script
> 
> On Fri, Nov 06, 2015 at 04:41:55PM +0100, Dietmar Maurer wrote: 
> > applied, thanks (good catch!) 
> 
> Since the diff between pve-bridge and pve-bridge-hotplug is only a few 
> lines, I wonder if we should just make it a parameter for the script 
> (or a second env var, whichever seems better)? 
> Should I prepare a patch? 
> 
> See the diff between the two files: 
> --- pve-bridge 2015-05-04 10:23:42.264921630 +0200 
> +++ pve-bridge-hotplug 2015-11-10 08:34:46.454064863 +0100 
> @@ -16,13 +16,11 @@ die "got strange interface name '$iface' 
> my $vmid = $1; 
> my $netid = "net$2"; 
> 
> -my $migratedfrom = $ENV{PVE_MIGRATED_FROM}; 
> - 
> -my $conf = PVE::QemuServer::load_config($vmid, $migratedfrom); 
> +my $conf = PVE::QemuServer::load_config($vmid); 
> 
> my $netconf = $conf->{$netid}; 
> 
> -$netconf = $conf->{pending}->{$netid} if !$migratedfrom &&
> defined($conf->{pending}->{$netid}); 
> +$netconf = $conf->{pending}->{$netid} if defined($conf->{pending}->{$netid});
> 
> 
> die "unable to get network config '$netid'\n" 
> if !defined($netconf); 
>




More information about the pve-devel mailing list