[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/4] Update modified mac address in place in virGetInterface

On Wed, Jul 22, 2009 at 12:22:08PM +0100, Daniel P. Berrange wrote:
> On Wed, Jul 22, 2009 at 01:20:57AM -0400, Laine Stump wrote:
> > If the mac address of an interface is changed, we must either create a
> > new virInterface object in the cache that has the new name/mac, or
> > modify the existing object in the cache. Because the cache is in a
> > hash that's indexed by name only, we can't create a new entry having
> > the same name without destroying the old one first (which isn't a
> > possibility as someone else is already referencing the old one), so
> > we're stuck modifying the existing entry. We have to do that without
> > changing the pointer to the mac though, so we really can only do it if
> > the length of the new mac is equal to or less than the old
> > mac. Otherwise, we have to just bail.
> > 
> > Fixing this problem to properly handle this corner case would require
> > a hash table that used both name and mac as keys, but that would be
> > inefficient (using the existing hash table implementation, which only
> > allows a single key), and probably unnecessary, as the length of mac
> > for any given interface will never change in practice.
> Yep, the odds of this error case happening are sooooo small, that
> giving a fatal error here is more than good enough.

  Agreed, patch applied, I only had to add _() to get the message


Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]