[pve-devel] [PATCH] add pve-bridge-hotplug script
Alexandre DERUMIER
aderumier at odiso.com
Tue Nov 10 10:25:10 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?
when you migrate, a new qemu process is started on target, so it don't care
about previous script of old qemu process.
(I have tested migrate, hotplug, migrate, hotplug, migrate, hotplug, it's works 100% with my current patch)
>>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
yes, I think it should work
----- Mail original -----
De: "Wolfgang Bumiller" <w.bumiller at proxmox.com>
À: "aderumier" <aderumier at odiso.com>
Cc: "pve-devel" <pve-devel at pve.proxmox.com>, "dietmar" <dietmar at proxmox.com>
Envoyé: Mardi 10 Novembre 2015 09:16:03
Objet: Re: [pve-devel] [PATCH] add pve-bridge-hotplug script
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