On 06/21/2011 10:21 AM, Stefan Berger wrote:
In a second cleanup step this patch makes several interface
functions
from macvtap.c commonly available by moving them into interface.c and
prefixing their names with 'iface'. Those functions taking
Linux-specific structures as parameters are only visible on Linux.
ifaceRestoreMacAddress returns the return code from the ifaceSetMacAddr
call and display an error message if setting the MAC address did not
work. The caller is unchanged and still ignores the return code (which
is ok).
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
src/libvirt_private.syms | 8
src/util/interface.c | 590
+++++++++++++++++++++++++++++++++++++++++++++++
src/util/interface.h | 33 ++
src/util/macvtap.c | 495 ---------------------------------------
4 files changed, 640 insertions(+), 486 deletions(-)
Same story about providing stubs on non-Linux platforms, for the purpose
of satisfying the libvirt_private.syms export listings.
+int
+ifaceMacvtapLinkDump(bool nltarget_kernel, const char *ifname, int
ifindex,
+ struct nlattr **tb, unsigned char **recvbuf,
+ uint32_t (*getPidFunc)(void))
A forward declaration of struct nlattr as an opaque type should be
enough to allow a dummy implementation of this function on non-Linux.
--- libvirt-acl.orig/src/util/interface.h
+++ libvirt-acl/src/util/interface.h
@@ -10,6 +10,13 @@
#ifndef __VIR_INTERFACE_H__
# define __VIR_INTERFACE_H__
+# include <stdint.h>
+
+# if __linux__
+# include <sys/socket.h>
+# include <linux/netlink.h>
+# endif
Here's where you could use an #else to do the forward declaration of
opaque types for non-Linux.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org