]> git.proxmox.com Git - vzctl.git/blame - debian/patches/pass-bridge-value-as-argument-to-VZNETCFG.patch
pass bridge value to vznetcfg script
[vzctl.git] / debian / patches / pass-bridge-value-as-argument-to-VZNETCFG.patch
CommitLineData
cfa11427
AD
1From 5a0960688341820ef7723e7bfbd159da580e93d0 Mon Sep 17 00:00:00 2001
2From: Alexandre Derumier <aderumier@odiso.com>
3Date: Sun, 11 May 2014 07:44:49 +0200
4Subject: [PATCH] pass bridge value as argument to VZNETCFG
5
6currently, only ifacename is passed to vznetcfg script. (and vznetaddbr)
7
8this is ok for vmstart,
9but if we want to change veth value online (new bridge, new vlan, new firewall)
10or hotplug a new card, with -netif_add
11
12this is not currently possible,
13because we read the bridge from vmid.conf in vznetaddbr, but vmid.conf is updated
14after -netif_add (and vznetaddbr).
15So we never have new value.
16
17This patch pass bridge value as argument to venetcfg script.
18We can now compare new and old value in vznetaddr, and see if it's an update or a new tap create.
19
20Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
21---
22 src/lib/veth.c | 3 ++-
23 1 file changed, 2 insertions(+), 1 deletion(-)
24
25diff --git a/src/lib/veth.c b/src/lib/veth.c
26index 2b63774..035c15c 100644
27--- a/src/lib/veth.c
28+++ b/src/lib/veth.c
29@@ -63,12 +63,13 @@ static int run_vznetcfg(envid_t veid, veth_dev *dev)
30 {
31 int ret;
32 char buf[16];
33- char *argv[] = {VZNETCFG, "init", "veth", NULL, NULL};
34+ char *argv[] = {VZNETCFG, "init", "veth", NULL, NULL, NULL};
35 char *env[2];
36
37 if (stat_file(VZNETCFG) != 1)
38 return 0;
39 argv[3] = dev->dev_name;
40+ argv[4] = dev->dev_bridge;
41 snprintf(buf, sizeof(buf), "VEID=%d", veid);
42 env[0] = buf;
43 env[1] = NULL;
44--
451.7.10.4
46