[libvirt] PATCH: Fix node device build on mingw32

The node device XML configuration handling routines contain a struct member called 'interface'. This seems to clash with a some typedef or function in the Win32 header files, causing horrific compile failure. This patch simply renames 'interface' to 'ifname'. Index: src/node_device_conf.c =================================================================== RCS file: /data/cvs/libvirt/src/node_device_conf.c,v retrieving revision 1.2 diff -r1.2 node_device_conf.c 272c272 < data->net.interface); ---
data->net.ifname);
377c377 < VIR_FREE(data->net.interface); ---
VIR_FREE(data->net.ifname);
Index: src/node_device_conf.h =================================================================== RCS file: /data/cvs/libvirt/src/node_device_conf.h,v retrieving revision 1.3 diff -r1.3 node_device_conf.h 105c105 < char *interface; ---
char *ifname;
Index: src/node_device_devkit.c =================================================================== RCS file: /data/cvs/libvirt/src/node_device_devkit.c,v retrieving revision 1.2 diff -r1.2 node_device_devkit.c 121c121 < const char *interface; ---
const char *ifname;
125,126c125,126 < interface = strrchr(sysfs_path, '/'); < if (!interface || !*interface || !*(++interface)) ---
ifname = strrchr(sysfs_path, '/'); if (!ifname || !*ifname || !*(++ifname))
128c128 < if ((d->net.interface = strdup(interface)) == NULL) ---
if ((d->net.ifname = strdup(ifname)) == NULL)
Index: src/node_device_hal.c =================================================================== RCS file: /data/cvs/libvirt/src/node_device_hal.c,v retrieving revision 1.2 diff -r1.2 node_device_hal.c 199c199 < (void)get_str_prop(ctx, udi, "net.interface", &d->net.interface); ---
(void)get_str_prop(ctx, udi, "net.interface", &d->net.ifname);
-- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Mon, Nov 24, 2008 at 04:49:29PM +0000, Daniel P. Berrange wrote:
The node device XML configuration handling routines contain a struct member called 'interface'. This seems to clash with a some typedef or function in the Win32 header files, causing horrific compile failure. This patch simply renames 'interface' to 'ifname'.
Sure, this is harmless, +1 Daniel -- 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/

On Tue, Nov 25, 2008 at 11:25:39AM +0100, Daniel Veillard wrote:
On Mon, Nov 24, 2008 at 04:49:29PM +0000, Daniel P. Berrange wrote:
The node device XML configuration handling routines contain a struct member called 'interface'. This seems to clash with a some typedef or function in the Win32 header files, causing horrific compile failure. This patch simply renames 'interface' to 'ifname'.
Sure, this is harmless,
Committed this patch. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Daniel P. Berrange
-
Daniel Veillard