[Pkg-libvirt-maintainers] Bug#533539: Bug#533539: virtinst: creating a new guest fails with (create:466) Generating macaddr failed
Guido Günther
agx at sigxcpu.org
Fri Jun 19 10:00:55 UTC 2009
found 533539 0.400.3-4
thanks
On Thu, Jun 18, 2009 at 04:07:34PM +0200, Andreas Unterkircher wrote:
> Problem occurs in default_bridge() function. It invokes default_route()
> to find out default-route's network device. I used 'brlan' as interface
> name for the bridge device, the default-route is pointing to dev brlan.
>
> unki at srv-gdo-vm01:~$ ip addr sh dev brlan
> 6: brlan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
> link/ether 00:22:64:fa:cb:b2 brd ff:ff:ff:ff:ff:ff
> inet 10.1.128.27/20 brd 10.1.143.255 scope global brlan
> inet6 fe80::222:64ff:fefa:cbb2/64 scope link
> valid_lft forever preferred_lft forever
> unki at srv-gdo-vm01:~$ ip ro sh dev brlan
> 10.1.128.0/20 proto kernel scope link src 10.1.128.27
> default via 10.1.128.1
>
>
> If I rename the bridge to br0, it works, as the code in line 107:
>
> defn = int(rt[-1])
>
> does not permitted a letter at the end of the device name.
>
> A quick fix:
>
> unki at srv-gdo-vm01:/usr/share/python-support/virtinst/virtinst$ diff -u util.py.orig util.py
> --- util.py.orig 2009-06-18 16:03:06.426793000 +0200
> +++ util.py 2009-06-18 16:03:24.146793189 +0200
> @@ -105,12 +105,12 @@
> if rt is None:
> defn = None
> else:
> - defn = int(rt[-1])
> + defn = rt
>
> if defn is None:
> return "xenbr0"
> else:
> - return "xenbr%d"%(defn)
> + return "xenbr%s"%(defn)
What about (untested):
if rt in None:
rt = "0"
try:
br = "xenbr%d" % int(rt[-1])
except ValueError:
br = rt
return br
This would keep the names compat with the old ones when ending in a
number but uses the bridge name only if it ends with a letter. Cole, Do
you have any input what would be the correct fix?
-- Guido
More information about the Pkg-libvirt-maintainers
mailing list