Re: [PATCH] qemu: fix attach/detach of netdevs with matching mac addrs

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

 



On 10/25/2012 02:31 PM, Laine Stump wrote:
> This resolves:
> 
>    https://bugzilla.redhat.com/show_bug.cgi?id=862515
> 
> which describes inconsistencies in dealing with duplicate mac
> addresses on network devices in a domain.
> 
> (at any rate, it resolves *almost* everything, and prints out an
> informative error message for the one problem that isn't solved, but
> has a workaround.)
> 

> @@ -6158,14 +6158,6 @@ qemuDomainAttachDeviceConfig(qemuCapsPtr caps,
>  
>      case VIR_DOMAIN_DEVICE_NET:
>          net = dev->data.net;
> -        if (virDomainNetIndexByMac(vmdef, &net->mac) >= 0) {
> -            char macbuf[VIR_MAC_STRING_BUFLEN];
> -
> -            virMacAddrFormat(&net->mac, macbuf);
> -            virReportError(VIR_ERR_INVALID_ARG,
> -                           _("mac %s already exists"), macbuf);
> -            return -1;
> -        }
>          if (virDomainNetInsert(vmdef, net)) {

Are you dropping functionality here?  Shouldn't you still be checking
that the new NetFindIdx function returns -1?

> -    vshError(ctl, _("No found interface whose MAC address is %s"), mac);
> -    goto cleanup;
> +    if (!matchNode) {
> +        vshError(ctl, _("No found interface whose MAC address is %s"), mac);

This would read better as 'No interface found', since you are already
touching this line.

ACK with those nits addressed; I like the overall improvement in error
messages.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]