Skip to contentSkip to conversation

fix vif IP specification broken in 12633:5bed7bc05c8a

PATCH In review Brendan Cully 3 participants 6 messages Dec 4, 2006 – Dec 7, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix vif IP specification broken in 12633:5bed7bc05c8a

# HG changeset patch
# User Brendan Cully <[email protected]>
# Date 1165276659 28800
# Node ID 013e995e2a6b0c5b237b29211e697b7757e5f94f # Parent fd28a1b139dea91b8bfcf06dd233dbdda8f51ff1 [XEND] fix vif IP specification broken in 12633:5bed7bc05c8a

Apparently at some point one could attach multiple IP addresses to a single VIF in the config file. This doesn't address that feature.

tools/python/xen/xend/server/netif.py +1 -1
diff -r fd28a1b139de -r 013e995e2a6b tools/python/xen/xend/server/netif.py
@@ -164,7 +164,7 @@ class NetifController(DevController):
             front = { 'handle' : "%i" % devid,
                       'mac'    : mac }
         if ipaddr:
-            back['ip'] = ' '.join(ipaddr)
+            back['ip'] = ipaddr
         if bridge:
             back['bridge'] = bridge
         if vifname:
#1 lore raw
Quoted 7 lines · Brendan Cully

# HG changeset patch
# User Brendan Cully <[email protected]>
# Date 1165276659 28800
# Node ID 013e995e2a6b0c5b237b29211e697b7757e5f94f # Parent fd28a1b139dea91b8bfcf06dd233dbdda8f51ff1 [XEND] fix vif IP specification broken in 12633:5bed7bc05c8a

Quoted 5 lines

Apparently at some point one could attach multiple IP addresses to a single VIF in the config file. This doesn't address that feature.

Sorry, I should have included a better description of the problem:

vif = ['ip=xxx.xxx.xxx.xxx'] hasn't worked since 12633 (at least with Xen's nat scripts). The problem is that pre-12633, the IP field returned from the config parser was a list, but now it is a string. So ' '.join(ip) ends up sending 'x x x . x x x . x x x . x x x' to the scripts, which were expecting less whitespace.

#2 lore raw
Quoted 14 lines · Brendan Cully
Quoted 7 lines · Brendan Cully

# HG changeset patch
# User Brendan Cully <[email protected]>
# Date 1165276659 28800
# Node ID 013e995e2a6b0c5b237b29211e697b7757e5f94f # Parent fd28a1b139dea91b8bfcf06dd233dbdda8f51ff1 [XEND] fix vif IP specification broken in 12633:5bed7bc05c8a

Quoted 5 lines

Apparently at some point one could attach multiple IP addresses to a single VIF in the config file. This doesn't address that feature.

Quoted 7 lines

Sorry, I should have included a better description of the problem:

vif = ['ip=xxx.xxx.xxx.xxx'] hasn't worked since 12633 (at least with Xen's nat scripts). The problem is that pre-12633, the IP field returned from the config parser was a list, but now it is a string. So ' '.join(ip) ends up sending 'x x x . x x x . x x x . x x x' to the scripts, which were expecting less whitespace.

So does your fix mean that multiple IP addresses work again, or can we only have one address this way? I'd prefer to fix the config parser if that's what's needed to support multiple IP addresses, since it certainly used to work.

Ewan.

#3 lore raw
Quoted 24 lines · Ewan Mellor
Quoted 14 lines · Brendan Cully
Quoted 7 lines · Brendan Cully

# HG changeset patch
# User Brendan Cully <[email protected]>
# Date 1165276659 28800
# Node ID 013e995e2a6b0c5b237b29211e697b7757e5f94f # Parent fd28a1b139dea91b8bfcf06dd233dbdda8f51ff1 [XEND] fix vif IP specification broken in 12633:5bed7bc05c8a

Quoted 5 lines

Apparently at some point one could attach multiple IP addresses to a single VIF in the config file. This doesn't address that feature.

Quoted 7 lines

Sorry, I should have included a better description of the problem:

vif = ['ip=xxx.xxx.xxx.xxx'] hasn't worked since 12633 (at least with Xen's nat scripts). The problem is that pre-12633, the IP field returned from the config parser was a list, but now it is a string. So ' '.join(ip) ends up sending 'x x x . x x x . x x x . x x x' to the scripts, which were expecting less whitespace.

Quoted 4 lines

So does your fix mean that multiple IP addresses work again, or can we only have one address this way? I'd prefer to fix the config parser if that's what's needed to support multiple IP addresses, since it certainly used to work.

This patch only supports a single IP address. It should easy enough to support a list again, but I didn't see an example of the config file syntax for multiple IPs. I presume the delimiter isn't ',' or ' '. Perhaps it's ['ip=foo, ip=bar'] ?

#4 lore raw
Quoted 30 lines · Brendan Cully
Quoted 24 lines · Ewan Mellor
Quoted 14 lines · Brendan Cully
Quoted 7 lines · Brendan Cully

# HG changeset patch
# User Brendan Cully <[email protected]>
# Date 1165276659 28800
# Node ID 013e995e2a6b0c5b237b29211e697b7757e5f94f # Parent fd28a1b139dea91b8bfcf06dd233dbdda8f51ff1 [XEND] fix vif IP specification broken in 12633:5bed7bc05c8a

Quoted 5 lines

Apparently at some point one could attach multiple IP addresses to a single VIF in the config file. This doesn't address that feature.

Quoted 7 lines

Sorry, I should have included a better description of the problem:

vif = ['ip=xxx.xxx.xxx.xxx'] hasn't worked since 12633 (at least with Xen's nat scripts). The problem is that pre-12633, the IP field returned from the config parser was a list, but now it is a string. So ' '.join(ip) ends up sending 'x x x . x x x . x x x . x x x' to the scripts, which were expecting less whitespace.

Quoted 4 lines

So does your fix mean that multiple IP addresses work again, or can we only have one address this way? I'd prefer to fix the config parser if that's what's needed to support multiple IP addresses, since it certainly used to work.

Quoted 4 lines

This patch only supports a single IP address. It should easy enough to support a list again, but I didn't see an example of the config file syntax for multiple IPs. I presume the delimiter isn't ',' or ' '. Perhaps it's ['ip=foo, ip=bar'] ?

FWIW it looks like the easiest syntax to support would be vif ['ip=192.168.1.2 192.168.1.3, mac=...']. Most of the current code doesn't seem prepared to handle multiple values for the same key, so you'd have to special-case vif ip in a few places.

The vif-nat script seems unprepared for multiple IPs though.

#5 lore raw
Quoted 10 lines · Brendan Cully
Quoted 10 lines
Quoted 10 lines
Quoted 5 lines

vif = ['ip=xxx.xxx.xxx.xxx'] hasn't worked since 12633 (at least with Xen's nat scripts). The problem is that pre-12633, the IP field returned from the config parser was a list, but now it is a string. So ' '.join(ip) ends up sending 'x x x . x x x . x x x . x x x' to the scripts, which were expecting less whitespace.

So does your fix mean that multiple IP addresses work again, or can we only have one address this way? I'd prefer to fix the config parser if that's what's needed to support multiple IP addresses, since it certainly used to work.

I cleaned up the device SXP parsing in XendConfig which has the side effect of fixing this IP address parsing problem in vif. The problem was the SXP parsing went through two different paths depending on which point the device configuration was inserted. This is in cs 12786.

The multiple IP address should still continue to work as before.

Cheers,

Alastair