]> git.proxmox.com Git - vzctl.git/commitdiff
pass bridge value to vznetcfg script
authorAlexandre Derumier <aderumier@odiso.com>
Fri, 23 May 2014 13:11:36 +0000 (15:11 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 3 Jun 2014 04:18:34 +0000 (06:18 +0200)
currently, only ifacenameis passed to vznetcfg script. (and vznetaddbr)

this is ok for vmstart,
but if we want to change veth value online (new bridge, new vlan, new firewall)
or hotplug a new card, with -netif_add

this is not currently possible,
because we read the bridge from vmid.conf in vznetaddbr, but vmid.conf is updated
after -netif_add (and vznetaddbr).
So we never have new value.

This patch pass bridge value as argument to venetcfg script.
We can now compare new and old value in vznetaddr, and see if it's an update or a new tap create.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
debian/patches/pass-bridge-value-as-argument-to-VZNETCFG.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/pass-bridge-value-as-argument-to-VZNETCFG.patch b/debian/patches/pass-bridge-value-as-argument-to-VZNETCFG.patch
new file mode 100644 (file)
index 0000000..087059a
--- /dev/null
@@ -0,0 +1,46 @@
+From 5a0960688341820ef7723e7bfbd159da580e93d0 Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <aderumier@odiso.com>
+Date: Sun, 11 May 2014 07:44:49 +0200
+Subject: [PATCH] pass bridge value as argument to VZNETCFG
+
+currently, only ifacename is passed to vznetcfg script. (and vznetaddbr)
+
+this is ok for vmstart,
+but if we want to change veth value online (new bridge, new vlan, new firewall)
+or hotplug a new card, with -netif_add
+
+this is not currently possible,
+because we read the bridge from vmid.conf in vznetaddbr, but vmid.conf is updated
+after -netif_add (and vznetaddbr).
+So we never have new value.
+
+This patch pass bridge value as argument to venetcfg script.
+We can now compare new and old value in vznetaddr, and see if it's an update or a new tap create.
+
+Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
+---
+ src/lib/veth.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib/veth.c b/src/lib/veth.c
+index 2b63774..035c15c 100644
+--- a/src/lib/veth.c
++++ b/src/lib/veth.c
+@@ -63,12 +63,13 @@ static int run_vznetcfg(envid_t veid, veth_dev *dev)
+ {
+       int ret;
+       char buf[16];
+-      char *argv[] = {VZNETCFG, "init", "veth", NULL, NULL};
++      char *argv[] = {VZNETCFG, "init", "veth", NULL, NULL, NULL};
+       char *env[2];
+       if (stat_file(VZNETCFG) != 1)
+               return 0;
+       argv[3] = dev->dev_name;
++      argv[4] = dev->dev_bridge;
+       snprintf(buf, sizeof(buf), "VEID=%d", veid);
+       env[0] = buf;
+       env[1] = NULL;
+-- 
+1.7.10.4
+
index 483ec4cb756d1c8617f1e3908243620f4ac39cdf..1153d99b42a608cc40c30851c525e23e85c9cf18 100644 (file)
@@ -9,3 +9,4 @@ allow-abs-ostemplate-path.diff
 always-create-dev-console.patch
 keep-bridge-MTU.patch
 fix-vzifup-post-error.patch
+pass-bridge-value-as-argument-to-VZNETCFG.patch