*
* Returns 0 on success, -1 on fatal error.
*/
-#if __linux__
+#if defined(__linux__) && WITH_MACVTAP
int
ifaceMacvtapLinkAdd(const char *type,
const unsigned char *macaddress, int macaddrsize,
int *retry ATTRIBUTE_UNUSED)
{
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
+# if defined(__linux__) && !WITH_MACVTAP
+ _("ifaceMacvtapLinkAdd is not supported since the include "
+ "files were too old"));
+# else
_("ifaceMacvtapLinkAdd is not supported on non-linux "
"platforms"));
+# endif
+
return -1;
}
*
* Returns 0 on success, -1 on fatal error.
*/
-#if __linux__
+#if defined( __linux__) && WITH_MACVTAP
int
ifaceLinkDel(const char *ifname)
{
ifaceLinkDel(const char *ifname ATTRIBUTE_UNUSED)
{
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
+# if defined(__linux__) && !WITH_MACVTAP
+ _("ifaceLinkDel is not supported since the include files "
+ "were too old"));
+# else
_("ifaceLinkDel is not supported on non-linux platforms"));
+# endif
return -1;
}
#endif
-#if __linux__
+#if defined(__linux__) && defined(IFLA_PORT_MAX)
+
static struct nla_policy ifla_policy[IFLA_MAX + 1] =
{
[IFLA_VF_PORTS] = { .type = NLA_NESTED },
uint32_t (*getPidFunc)(void) ATTRIBUTE_UNUSED)
{
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
+# if defined(__linux__) && !defined(IFLA_PORT_MAX)
+ _("ifaceMacvtapLinkDump is not supported since the include "
+ "files were too old"));
+# else
_("ifaceMacvtapLinkDump is not supported on non-linux "
"platforms"));
+# endif
+
return -1;
}
*
* Return 0 on success, != 0 otherwise
*/
-#if __linux__
+#if defined(__linux__) && WITH_MACVTAP
int
ifaceGetNthParent(int ifindex, const char *ifname, unsigned int nthParent,
int *parent_ifindex, char *parent_ifname,
unsigned int *nth ATTRIBUTE_UNUSED)
{
ifaceError(VIR_ERR_INTERNAL_ERROR, "%s",
+# if defined(__linux__) && !WITH_MACVTAP
+ _("ifaceGetNthParent is not supported since the include files "
+ "were too old"));
+# else
_("ifaceGetNthParent is not supported on non-linux platforms"));
+# endif
return -1;
}
* Returns 0 on success, -1 on error. In case of error, no response
* buffer will be returned.
*/
-#if __linux__
+#if defined(__linux__) && defined(HAVE_LIBNL)
int nlComm(struct nl_msg *nl_msg,
unsigned char **respbuf, unsigned int *respbuflen,
int nl_pid)
int nl_pid ATTRIBUTE_UNUSED)
{
netlinkError(VIR_ERR_INTERNAL_ERROR, "%s",
+# if defined(__linux__) && !defined(HAVE_LIBNL)
+ _("nlComm is not supported since libnl was not available"));
+# else
_("nlComm is not supported on non-linux platforms"));
+# endif
return -1;
}