[libvirt] [PATCH] Fix build for platforms lacking struct ifreq

Eric Blake eblake at redhat.com
Sat Dec 3 18:35:20 UTC 2011


On 12/01/2011 01:55 PM, Eric Blake wrote:
> On 12/01/2011 07:22 AM, Daniel Veillard wrote:
>> On Thu, Dec 01, 2011 at 01:31:18PM +0000, Daniel P. Berrange wrote:
>>> From: "Daniel P. Berrange" <berrange at redhat.com>
>>>
>>> This ought to fix the build if you have net/if.h but do
>>> not have struct ifreq
>>>
>>
>>   ACK, seems this should take care of the reported BSD incompatibility
> 
> I've confirmed it on FreeBSD, and am pushing this under the
> build-breaker rule.

Alas, the fix is incomplete.  Cygwin has struct ifreq but lacks ioctl
SIOCSIFHWADDR:

util/virnetdev.c: In function 'virNetDevSetupControl':
util/virnetdev.c:85:51: error: 'AF_PACKET' undeclared (first use in this
function)
util/virnetdev.c:85:51: note: each undeclared identifier is reported
only once for each function it appears in
util/virnetdev.c: In function 'virNetDevSetMAC':
util/virnetdev.c:164:19: error: 'SIOCSIFHWADDR' undeclared (first use in
this function)
util/virnetdev.c: In function 'virNetDevGetIndex':
util/virnetdev.c:634:21: error: 'PF_PACKET' undeclared (first use in
this function)
util/virnetdev.c: In function 'virNetDevSetupControl':
util/virnetdev.c:86:1: warning: control reaches end of non-void function
[-Wreturn-type]

I'm testing a patch to further restrict the condition to just Linux,
rather than going off of struct ifreq.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111203/20d2b811/attachment-0001.sig>


More information about the libvir-list mailing list