]>
Commit | Line | Data |
---|---|---|
cfa11427 AD |
1 | From 5a0960688341820ef7723e7bfbd159da580e93d0 Mon Sep 17 00:00:00 2001 |
2 | From: Alexandre Derumier <aderumier@odiso.com> | |
3 | Date: Sun, 11 May 2014 07:44:49 +0200 | |
4 | Subject: [PATCH] pass bridge value as argument to VZNETCFG | |
5 | ||
6 | currently, only ifacename is passed to vznetcfg script. (and vznetaddbr) | |
7 | ||
8 | this is ok for vmstart, | |
9 | but if we want to change veth value online (new bridge, new vlan, new firewall) | |
10 | or hotplug a new card, with -netif_add | |
11 | ||
12 | this is not currently possible, | |
13 | because we read the bridge from vmid.conf in vznetaddbr, but vmid.conf is updated | |
14 | after -netif_add (and vznetaddbr). | |
15 | So we never have new value. | |
16 | ||
17 | This patch pass bridge value as argument to venetcfg script. | |
18 | We can now compare new and old value in vznetaddr, and see if it's an update or a new tap create. | |
19 | ||
20 | Signed-off-by: Alexandre Derumier <aderumier@odiso.com> | |
21 | --- | |
22 | src/lib/veth.c | 3 ++- | |
23 | 1 file changed, 2 insertions(+), 1 deletion(-) | |
24 | ||
25 | diff --git a/src/lib/veth.c b/src/lib/veth.c | |
26 | index 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 | -- | |
45 | 1.7.10.4 | |
46 |