mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
Make virNetDevSetupControl() public.
This method is useful not only in virnetdev.c.
This commit is contained in:
parent
0f81bdb2f7
commit
9614d70b0c
@ -1532,6 +1532,7 @@ virNetDevSetMTUFromDevice;
|
|||||||
virNetDevSetName;
|
virNetDevSetName;
|
||||||
virNetDevSetNamespace;
|
virNetDevSetNamespace;
|
||||||
virNetDevSetOnline;
|
virNetDevSetOnline;
|
||||||
|
virNetDevSetupControl;
|
||||||
virNetDevValidateConfig;
|
virNetDevValidateConfig;
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,12 +88,23 @@ static int virNetDevSetupControlFull(const char *ifname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int virNetDevSetupControl(const char *ifname,
|
int
|
||||||
struct ifreq *ifr)
|
virNetDevSetupControl(const char *ifname,
|
||||||
|
struct ifreq *ifr)
|
||||||
{
|
{
|
||||||
return virNetDevSetupControlFull(ifname, ifr, VIR_NETDEV_FAMILY, SOCK_DGRAM);
|
return virNetDevSetupControlFull(ifname, ifr, VIR_NETDEV_FAMILY, SOCK_DGRAM);
|
||||||
}
|
}
|
||||||
#endif
|
#else /* !HAVE_STRUCT_IFREQ */
|
||||||
|
int
|
||||||
|
virNetDevSetupControl(const char *ifname ATTRIBUTE_UNUSED,
|
||||||
|
void *ifr ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
virReportSystemError(ENOSYS, "%s",
|
||||||
|
_("Network device configuration is not supported "
|
||||||
|
"on this platform"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_STRUCT_IFREQ */
|
||||||
|
|
||||||
|
|
||||||
#if defined(SIOCGIFFLAGS) && defined(HAVE_STRUCT_IFREQ)
|
#if defined(SIOCGIFFLAGS) && defined(HAVE_STRUCT_IFREQ)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2007-2012 Red Hat, Inc.
|
* Copyright (C) 2007-2013 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -23,11 +23,23 @@
|
|||||||
#ifndef __VIR_NETDEV_H__
|
#ifndef __VIR_NETDEV_H__
|
||||||
# define __VIR_NETDEV_H__
|
# define __VIR_NETDEV_H__
|
||||||
|
|
||||||
|
# include <net/if.h>
|
||||||
|
|
||||||
# include "virsocketaddr.h"
|
# include "virsocketaddr.h"
|
||||||
# include "virnetlink.h"
|
# include "virnetlink.h"
|
||||||
# include "virmacaddr.h"
|
# include "virmacaddr.h"
|
||||||
# include "virpci.h"
|
# include "virpci.h"
|
||||||
|
|
||||||
|
# ifdef HAVE_STRUCT_IFREQ
|
||||||
|
typedef struct ifreq virIfreq;
|
||||||
|
# else
|
||||||
|
typedef void virIfreq;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
int virNetDevSetupControl(const char *ifname,
|
||||||
|
virIfreq *ifr)
|
||||||
|
ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
int virNetDevExists(const char *brname)
|
int virNetDevExists(const char *brname)
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user