[Pkg-libvirt-maintainers] Bug#533539: Bug#533539: virtinst: creating a new guest fails with (create:466) Generating macaddr failed

Cole Robinson crobinso at redhat.com
Fri Jun 19 12:19:29 UTC 2009


On 06/19/2009 06:00 AM, Guido Günther wrote:
> 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
> 

Actually, we had a similar bug reported against fedora, which I just fixed
upstream yesterday!:

http://hg.et.redhat.com/cgi-bin/hg-virt.cgi/applications/virtinst--devel/rev/503cd42936a9

That 'default_bridge' function is bogus, but it's part of the public API in
'util' so we need to maintain it's behavior.

- Cole





More information about the Pkg-libvirt-maintainers mailing list