maint: avoid 'const fooPtr' in virnet files

'const fooPtr' is the same as 'foo * const' (the pointer won't
change, but it's contents can).  But in general, if an interface
is trying to be const-correct, it should be using 'const foo *'
(the pointer is to data that can't be changed).

Fix up remaining offenders in src/util.

* src/util/virnetdev.h (virNetDevSetMAC)
(virNetDevReplaceMacAddress, virNetDevValidateConfig)
(virNetDevReplaceNetConfig): Use intended type.
* src/util/virnetdevbandwidth.h (virNetDevBandwidthCopy)
(virNetDevBandwidthPlug): Likewise.
* src/util/virnetdevmacvlan.h (virNetDevMacVLanCreate)
(virNetDevMacVLanCreateWithVPortProfile)
(virNetDevMacVLanDeleteWithVPortProfile)
(virNetDevMacVLanRestartWithVPortProfile)
(virNetDevMacVLanVPortProfileRegisterCallback): Likewise.
* src/util/virnetdevopenvswitch.h (virNetDevOpenvswitchAddPort):
Likewise.
* src/util/virnetdevtap.h (virNetDevTapCreateInBridgePort):
Likewise.
* src/util/virnetdevvlan.h (virNetDevVlanEqual)
(virNetDevVlanCopy): Likewise.
* src/util/virnetdevvportprofile.h
(virNetDevVPortProfileAssociate)
(virNetDevVPortProfileDisassociate): Likewise.
* src/util/virnetlink.h (virNetlinkEventRemoveCallback)
(virNetlinkEventAddClient, virNetlinkEventRemoveClient):
Likewise.
* src/util/virnetdev.c (virNetDevSetMAC)
(virNetDevReplaceMacAddress, virNetDevValidateConfig)
(virNetDevReplaceNetConfig): Fix fallout.
* src/util/virnetdevbandwidth.c (virNetDevBandwidthCopy)
(virNetDevBandwidthPlug): Likewise.
* src/util/virnetdevmacvlan.c (virNetDevMacVLanCreate)
(virNetDevMacVLanCreateWithVPortProfile)
(virNetDevMacVLanDeleteWithVPortProfile)
(virNetDevMacVLanRestartWithVPortProfile)
(virNetDevMacVLanVPortProfileRegisterCallback): Likewise.
* src/util/virnetdevopenvswitch.c (virNetDevOpenvswitchAddPort):
Likewise.
* src/util/virnetdevtap.c (virNetDevTapCreateInBridgePort):
Likewise.
* src/util/virnetdevvlan.c (virNetDevVlanEqual)
(virNetDevVlanCopy): Likewise.
* src/util/virnetdevvportprofile.c
(virNetDevVPortProfileAssociate)
(virNetDevVPortProfileDisassociate)
(virNetDevVPortProfileOpSetLink, virNetDevVPortProfileOpCommon)
(virNetDevVPortProfileOp8021Qbg, virNetDevVPortProfileOp8021Qbh):
Likewise.
* src/util/virnetlink.c (virNetlinkEventRemoveCallback)
(virNetlinkEventAddClient, virNetlinkEventRemoveClient):
Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Eric Blake 2013-10-05 13:41:44 -06:00
parent 1b0bc4169f
commit 955af4d4c1
16 changed files with 80 additions and 75 deletions

View File

@ -165,7 +165,7 @@ int virNetDevExists(const char *ifname)
* Returns 0 in case of success or -1 on failure * Returns 0 in case of success or -1 on failure
*/ */
int virNetDevSetMAC(const char *ifname, int virNetDevSetMAC(const char *ifname,
const virMacAddrPtr macaddr) const virMacAddr *macaddr)
{ {
int fd = -1; int fd = -1;
int ret = -1; int ret = -1;
@ -200,7 +200,7 @@ cleanup:
#elif defined(SIOCSIFLLADDR) && defined(HAVE_STRUCT_IFREQ) && \ #elif defined(SIOCSIFLLADDR) && defined(HAVE_STRUCT_IFREQ) && \
HAVE_DECL_LINK_ADDR HAVE_DECL_LINK_ADDR
int virNetDevSetMAC(const char *ifname, int virNetDevSetMAC(const char *ifname,
const virMacAddrPtr macaddr) const virMacAddr *macaddr)
{ {
struct ifreq ifr; struct ifreq ifr;
struct sockaddr_dl sdl; struct sockaddr_dl sdl;
@ -233,7 +233,7 @@ cleanup:
} }
#else #else
int virNetDevSetMAC(const char *ifname, int virNetDevSetMAC(const char *ifname,
const virMacAddrPtr macaddr ATTRIBUTE_UNUSED) const virMacAddr *macaddr ATTRIBUTE_UNUSED)
{ {
virReportSystemError(ENOSYS, virReportSystemError(ENOSYS,
_("Cannot set interface MAC on '%s'"), _("Cannot set interface MAC on '%s'"),
@ -302,7 +302,7 @@ int virNetDevGetMAC(const char *ifname,
*/ */
int int
virNetDevReplaceMacAddress(const char *linkdev, virNetDevReplaceMacAddress(const char *linkdev,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
const char *stateDir) const char *stateDir)
{ {
virMacAddr oldmac; virMacAddr oldmac;
@ -1002,7 +1002,7 @@ int virNetDevGetIPv4Address(const char *ifname ATTRIBUTE_UNUSED,
*/ */
#if defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ) #if defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ)
int virNetDevValidateConfig(const char *ifname, int virNetDevValidateConfig(const char *ifname,
const virMacAddrPtr macaddr, int ifindex) const virMacAddr *macaddr, int ifindex)
{ {
int fd = -1; int fd = -1;
int ret = -1; int ret = -1;
@ -1056,7 +1056,7 @@ int virNetDevValidateConfig(const char *ifname,
} }
#else #else
int virNetDevValidateConfig(const char *ifname ATTRIBUTE_UNUSED, int virNetDevValidateConfig(const char *ifname ATTRIBUTE_UNUSED,
const virMacAddrPtr macaddr ATTRIBUTE_UNUSED, const virMacAddr *macaddr ATTRIBUTE_UNUSED,
int ifindex ATTRIBUTE_UNUSED) int ifindex ATTRIBUTE_UNUSED)
{ {
virReportSystemError(ENOSYS, "%s", virReportSystemError(ENOSYS, "%s",
@ -1461,7 +1461,7 @@ buffer_too_small:
static int static int
virNetDevSetVfConfig(const char *ifname, int ifindex, int vf, virNetDevSetVfConfig(const char *ifname, int ifindex, int vf,
bool nltarget_kernel, const virMacAddrPtr macaddr, bool nltarget_kernel, const virMacAddr *macaddr,
int vlanid, uint32_t (*getPidFunc)(void)) int vlanid, uint32_t (*getPidFunc)(void))
{ {
int rc = -1; int rc = -1;
@ -1655,7 +1655,7 @@ virNetDevGetVfConfig(const char *ifname, int vf, virMacAddrPtr mac,
static int static int
virNetDevReplaceVfConfig(const char *pflinkdev, int vf, virNetDevReplaceVfConfig(const char *pflinkdev, int vf,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
int vlanid, int vlanid,
const char *stateDir) const char *stateDir)
{ {
@ -1759,7 +1759,7 @@ cleanup:
*/ */
int int
virNetDevReplaceNetConfig(char *linkdev, int vf, virNetDevReplaceNetConfig(char *linkdev, int vf,
const virMacAddrPtr macaddress, int vlanid, const virMacAddr *macaddress, int vlanid,
char *stateDir) char *stateDir)
{ {
if (vf == -1) if (vf == -1)
@ -1804,7 +1804,7 @@ virNetDevLinkDump(const char *ifname ATTRIBUTE_UNUSED,
int int
virNetDevReplaceNetConfig(char *linkdev ATTRIBUTE_UNUSED, virNetDevReplaceNetConfig(char *linkdev ATTRIBUTE_UNUSED,
int vf ATTRIBUTE_UNUSED, int vf ATTRIBUTE_UNUSED,
const virMacAddrPtr macaddress ATTRIBUTE_UNUSED, const virMacAddr *macaddress ATTRIBUTE_UNUSED,
int vlanid ATTRIBUTE_UNUSED, int vlanid ATTRIBUTE_UNUSED,
char *stateDir ATTRIBUTE_UNUSED) char *stateDir ATTRIBUTE_UNUSED)
{ {

View File

@ -70,14 +70,14 @@ int virNetDevGetIPv4Address(const char *ifname, virSocketAddrPtr addr)
int virNetDevSetMAC(const char *ifname, int virNetDevSetMAC(const char *ifname,
const virMacAddrPtr macaddr) const virMacAddr *macaddr)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
int virNetDevGetMAC(const char *ifname, int virNetDevGetMAC(const char *ifname,
virMacAddrPtr macaddr) virMacAddrPtr macaddr)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
int virNetDevReplaceMacAddress(const char *linkdev, int virNetDevReplaceMacAddress(const char *linkdev,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
const char *stateDir) const char *stateDir)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_RETURN_CHECK;
@ -107,7 +107,7 @@ int virNetDevGetVLanID(const char *ifname, int *vlanid)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
int virNetDevValidateConfig(const char *ifname, int virNetDevValidateConfig(const char *ifname,
const virMacAddrPtr macaddr, int ifindex) const virMacAddr *macaddr, int ifindex)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
int virNetDevIsVirtualFunction(const char *ifname) int virNetDevIsVirtualFunction(const char *ifname)
@ -134,7 +134,7 @@ int virNetDevLinkDump(const char *ifname, int ifindex,
ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_RETURN_CHECK;
int virNetDevReplaceNetConfig(char *linkdev, int vf, int virNetDevReplaceNetConfig(char *linkdev, int vf,
const virMacAddrPtr macaddress, int vlanid, const virMacAddr *macaddress, int vlanid,
char *stateDir) char *stateDir)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(5); ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(5);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009-2012 Red Hat, Inc. * Copyright (C) 2009-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
@ -287,7 +287,7 @@ virNetDevBandwidthClear(const char *ifname)
*/ */
int int
virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest, virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest,
const virNetDevBandwidthPtr src) const virNetDevBandwidth *src)
{ {
int ret = -1; int ret = -1;
@ -386,7 +386,7 @@ virNetDevBandwidthEqual(virNetDevBandwidthPtr a,
int int
virNetDevBandwidthPlug(const char *brname, virNetDevBandwidthPlug(const char *brname,
virNetDevBandwidthPtr net_bandwidth, virNetDevBandwidthPtr net_bandwidth,
const virMacAddrPtr ifmac_ptr, const virMacAddr *ifmac_ptr,
virNetDevBandwidthPtr bandwidth, virNetDevBandwidthPtr bandwidth,
unsigned int id) unsigned int id)
{ {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009-2012 Red Hat, Inc. * Copyright (C) 2009-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
@ -49,14 +49,15 @@ int virNetDevBandwidthSet(const char *ifname,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
int virNetDevBandwidthClear(const char *ifname) int virNetDevBandwidthClear(const char *ifname)
ATTRIBUTE_NONNULL(1); ATTRIBUTE_NONNULL(1);
int virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest, const virNetDevBandwidthPtr src) int virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest,
const virNetDevBandwidth *src)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
bool virNetDevBandwidthEqual(virNetDevBandwidthPtr a, virNetDevBandwidthPtr b); bool virNetDevBandwidthEqual(virNetDevBandwidthPtr a, virNetDevBandwidthPtr b);
int virNetDevBandwidthPlug(const char *brname, int virNetDevBandwidthPlug(const char *brname,
virNetDevBandwidthPtr net_bandwidth, virNetDevBandwidthPtr net_bandwidth,
const virMacAddrPtr ifmac_ptr, const virMacAddr *ifmac_ptr,
virNetDevBandwidthPtr bandwidth, virNetDevBandwidthPtr bandwidth,
unsigned int id) unsigned int id)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)

View File

@ -104,7 +104,7 @@ VIR_ONCE_GLOBAL_INIT(virNetDevMacVLanCreateMutex);
int int
virNetDevMacVLanCreate(const char *ifname, virNetDevMacVLanCreate(const char *ifname,
const char *type, const char *type,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
const char *srcdev, const char *srcdev,
uint32_t macvlan_mode, uint32_t macvlan_mode,
int *retry) int *retry)
@ -746,7 +746,7 @@ virNetlinkCallbackDataFree(virNetlinkCallbackDataPtr calld)
*/ */
static void static void
virNetDevMacVLanVPortProfileDestroyCallback(int watch ATTRIBUTE_UNUSED, virNetDevMacVLanVPortProfileDestroyCallback(int watch ATTRIBUTE_UNUSED,
const virMacAddrPtr macaddr ATTRIBUTE_UNUSED, const virMacAddr *macaddr ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virNetlinkCallbackDataFree((virNetlinkCallbackDataPtr)opaque); virNetlinkCallbackDataFree((virNetlinkCallbackDataPtr)opaque);
@ -754,7 +754,7 @@ virNetDevMacVLanVPortProfileDestroyCallback(int watch ATTRIBUTE_UNUSED,
int int
virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname, virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
const char *linkdev, const char *linkdev,
const unsigned char *vmuuid, const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile, virNetDevVPortProfilePtr virtPortProfile,
@ -811,7 +811,7 @@ error:
* otherwise returns 0; returns -1 on error. * otherwise returns 0; returns -1 on error.
*/ */
int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname, int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
const char *linkdev, const char *linkdev,
enum virNetDevMacVLanMode mode, enum virNetDevMacVLanMode mode,
bool withTap, bool withTap,
@ -985,7 +985,7 @@ link_del_exit:
* were provided. * were provided.
*/ */
int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname, int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
const virMacAddrPtr macaddr, const virMacAddr *macaddr,
const char *linkdev, const char *linkdev,
int mode, int mode,
virNetDevVPortProfilePtr virtPortProfile, virNetDevVPortProfilePtr virtPortProfile,
@ -1030,7 +1030,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
* Returns 0; returns -1 on error. * Returns 0; returns -1 on error.
*/ */
int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname, int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
const char *linkdev, const char *linkdev,
const unsigned char *vmuuid, const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile, virNetDevVPortProfilePtr virtPortProfile,
@ -1060,7 +1060,7 @@ error:
#else /* ! WITH_MACVTAP */ #else /* ! WITH_MACVTAP */
int virNetDevMacVLanCreate(const char *ifname ATTRIBUTE_UNUSED, int virNetDevMacVLanCreate(const char *ifname ATTRIBUTE_UNUSED,
const char *type ATTRIBUTE_UNUSED, const char *type ATTRIBUTE_UNUSED,
const virMacAddrPtr macaddress ATTRIBUTE_UNUSED, const virMacAddr *macaddress ATTRIBUTE_UNUSED,
const char *srcdev ATTRIBUTE_UNUSED, const char *srcdev ATTRIBUTE_UNUSED,
uint32_t macvlan_mode ATTRIBUTE_UNUSED, uint32_t macvlan_mode ATTRIBUTE_UNUSED,
int *retry ATTRIBUTE_UNUSED) int *retry ATTRIBUTE_UNUSED)
@ -1078,7 +1078,7 @@ int virNetDevMacVLanDelete(const char *ifname ATTRIBUTE_UNUSED)
} }
int virNetDevMacVLanCreateWithVPortProfile(const char *ifname ATTRIBUTE_UNUSED, int virNetDevMacVLanCreateWithVPortProfile(const char *ifname ATTRIBUTE_UNUSED,
const virMacAddrPtr macaddress ATTRIBUTE_UNUSED, const virMacAddr *macaddress ATTRIBUTE_UNUSED,
const char *linkdev ATTRIBUTE_UNUSED, const char *linkdev ATTRIBUTE_UNUSED,
enum virNetDevMacVLanMode mode ATTRIBUTE_UNUSED, enum virNetDevMacVLanMode mode ATTRIBUTE_UNUSED,
bool withTap ATTRIBUTE_UNUSED, bool withTap ATTRIBUTE_UNUSED,
@ -1096,7 +1096,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname ATTRIBUTE_UNUSED,
} }
int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname ATTRIBUTE_UNUSED, int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname ATTRIBUTE_UNUSED,
const virMacAddrPtr macaddress ATTRIBUTE_UNUSED, const virMacAddr *macaddress ATTRIBUTE_UNUSED,
const char *linkdev ATTRIBUTE_UNUSED, const char *linkdev ATTRIBUTE_UNUSED,
int mode ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED, virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED,
@ -1108,7 +1108,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname ATTRIBUTE_UNUSED,
} }
int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname ATTRIBUTE_UNUSED, int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname ATTRIBUTE_UNUSED,
const virMacAddrPtr macaddress ATTRIBUTE_UNUSED, const virMacAddr *macaddress ATTRIBUTE_UNUSED,
const char *linkdev ATTRIBUTE_UNUSED, const char *linkdev ATTRIBUTE_UNUSED,
const unsigned char *vmuuid ATTRIBUTE_UNUSED, const unsigned char *vmuuid ATTRIBUTE_UNUSED,
virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED, virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED,
@ -1120,7 +1120,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname ATTRIBUTE_UNUS
} }
int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname ATTRIBUTE_UNUSED, int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname ATTRIBUTE_UNUSED,
const virMacAddrPtr macaddress ATTRIBUTE_UNUSED, const virMacAddr *macaddress ATTRIBUTE_UNUSED,
const char *linkdev ATTRIBUTE_UNUSED, const char *linkdev ATTRIBUTE_UNUSED,
const unsigned char *vmuuid ATTRIBUTE_UNUSED, const unsigned char *vmuuid ATTRIBUTE_UNUSED,
virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED, virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2011 Red Hat, Inc. * Copyright (C) 2011, 2013 Red Hat, Inc.
* Copyright (C) 2010 IBM Corporation * Copyright (C) 2010 IBM Corporation
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -42,7 +42,7 @@ VIR_ENUM_DECL(virNetDevMacVLanMode)
int virNetDevMacVLanCreate(const char *ifname, int virNetDevMacVLanCreate(const char *ifname,
const char *type, const char *type,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
const char *srcdev, const char *srcdev,
uint32_t macvlan_mode, uint32_t macvlan_mode,
int *retry) int *retry)
@ -53,7 +53,7 @@ int virNetDevMacVLanDelete(const char *ifname)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
int virNetDevMacVLanCreateWithVPortProfile(const char *ifname, int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
const char *linkdev, const char *linkdev,
enum virNetDevMacVLanMode mode, enum virNetDevMacVLanMode mode,
bool withTap, bool withTap,
@ -68,7 +68,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
ATTRIBUTE_NONNULL(9) ATTRIBUTE_NONNULL(11) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(9) ATTRIBUTE_NONNULL(11) ATTRIBUTE_RETURN_CHECK;
int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname, int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
const char *linkdev, const char *linkdev,
int mode, int mode,
virNetDevVPortProfilePtr virtPortProfile, virNetDevVPortProfilePtr virtPortProfile,
@ -77,7 +77,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
ATTRIBUTE_NONNULL(6) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(6) ATTRIBUTE_RETURN_CHECK;
int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname, int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
const char *linkdev, const char *linkdev,
const unsigned char *vmuuid, const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile, virNetDevVPortProfilePtr virtPortProfile,
@ -86,7 +86,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname, int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
const virMacAddrPtr macaddress, const virMacAddr *macaddress,
const char *linkdev, const char *linkdev,
const unsigned char *vmuuid, const unsigned char *vmuuid,
virNetDevVPortProfilePtr virtPortProfile, virNetDevVPortProfilePtr virtPortProfile,

View File

@ -1,4 +1,5 @@
/* /*
* Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) 2012 Nicira, Inc. * Copyright (C) 2012 Nicira, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -45,7 +46,7 @@
* Returns 0 in case of success or -1 in case of failure. * Returns 0 in case of success or -1 in case of failure.
*/ */
int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname, int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
const virMacAddrPtr macaddr, const virMacAddr *macaddr,
const unsigned char *vmuuid, const unsigned char *vmuuid,
virNetDevVPortProfilePtr ovsport, virNetDevVPortProfilePtr ovsport,
virNetDevVlanPtr virtVlan) virNetDevVlanPtr virtVlan)

View File

@ -1,4 +1,5 @@
/* /*
* Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) 2012 Nicira, Inc. * Copyright (C) 2012 Nicira, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -31,7 +32,7 @@
int virNetDevOpenvswitchAddPort(const char *brname, int virNetDevOpenvswitchAddPort(const char *brname,
const char *ifname, const char *ifname,
const virMacAddrPtr macaddr, const virMacAddr *macaddr,
const unsigned char *vmuuid, const unsigned char *vmuuid,
virNetDevVPortProfilePtr ovsport, virNetDevVPortProfilePtr ovsport,
virNetDevVlanPtr virtVlan) virNetDevVlanPtr virtVlan)

View File

@ -435,7 +435,7 @@ int virNetDevTapDelete(const char *ifname ATTRIBUTE_UNUSED)
*/ */
int virNetDevTapCreateInBridgePort(const char *brname, int virNetDevTapCreateInBridgePort(const char *brname,
char **ifname, char **ifname,
const virMacAddrPtr macaddr, const virMacAddr *macaddr,
const unsigned char *vmuuid, const unsigned char *vmuuid,
int *tapfd, int *tapfd,
int tapfdSize, int tapfdSize,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2007-2011 Red Hat, Inc. * Copyright (C) 2007-2011, 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
@ -53,7 +53,7 @@ typedef enum {
int virNetDevTapCreateInBridgePort(const char *brname, int virNetDevTapCreateInBridgePort(const char *brname,
char **ifname, char **ifname,
const virMacAddrPtr macaddr, const virMacAddr *macaddr,
const unsigned char *vmuuid, const unsigned char *vmuuid,
int *tapfd, int *tapfd,
int tapfdSize, int tapfdSize,

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009-2012 Red Hat, Inc. * Copyright (C) 2009-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
@ -46,7 +46,7 @@ virNetDevVlanFree(virNetDevVlanPtr vlan)
} }
int int
virNetDevVlanEqual(const virNetDevVlanPtr a, const virNetDevVlanPtr b) virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b)
{ {
int ai, bi; int ai, bi;
@ -81,7 +81,7 @@ virNetDevVlanEqual(const virNetDevVlanPtr a, const virNetDevVlanPtr b)
* dst is assumed to be empty on entry. * dst is assumed to be empty on entry.
*/ */
int int
virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlanPtr src) virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src)
{ {
if (!src || src->nTags == 0) if (!src || src->nTags == 0)
return 0; return 0;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009-2012 Red Hat, Inc. * Copyright (C) 2009-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
@ -45,7 +45,7 @@ struct _virNetDevVlan {
void virNetDevVlanClear(virNetDevVlanPtr vlan); void virNetDevVlanClear(virNetDevVlanPtr vlan);
void virNetDevVlanFree(virNetDevVlanPtr vlan); void virNetDevVlanFree(virNetDevVlanPtr vlan);
int virNetDevVlanEqual(const virNetDevVlanPtr a, const virNetDevVlanPtr b); int virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b);
int virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlanPtr src); int virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src);
#endif /* __VIR_NETDEV_VLAN_H__ */ #endif /* __VIR_NETDEV_VLAN_H__ */

View File

@ -583,7 +583,7 @@ cleanup:
static int static int
virNetDevVPortProfileOpSetLink(const char *ifname, int ifindex, virNetDevVPortProfileOpSetLink(const char *ifname, int ifindex,
bool nltarget_kernel, bool nltarget_kernel,
const virMacAddrPtr macaddr, const virMacAddr *macaddr,
int vlanid, int vlanid,
const char *profileId, const char *profileId,
struct ifla_port_vsi *portVsi, struct ifla_port_vsi *portVsi,
@ -828,7 +828,7 @@ virNetDevVPortProfileGetNthParent(const char *ifname, int ifindex, unsigned int
static int static int
virNetDevVPortProfileOpCommon(const char *ifname, int ifindex, virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
bool nltarget_kernel, bool nltarget_kernel,
const virMacAddrPtr macaddr, const virMacAddr *macaddr,
int vlanid, int vlanid,
const char *profileId, const char *profileId,
struct ifla_port_vsi *portVsi, struct ifla_port_vsi *portVsi,
@ -942,9 +942,9 @@ virNetDevVPortProfileGetPhysdevAndVlan(const char *ifname, int *root_ifindex, ch
/* Returns 0 on success, -1 on general failure, and -2 on timeout */ /* Returns 0 on success, -1 on general failure, and -2 on timeout */
static int static int
virNetDevVPortProfileOp8021Qbg(const char *ifname, virNetDevVPortProfileOp8021Qbg(const char *ifname,
const virMacAddrPtr macaddr, const virMacAddr *macaddr,
int vf, int vf,
const virNetDevVPortProfilePtr virtPort, const virNetDevVPortProfile *virtPort,
enum virNetDevVPortProfileLinkOp virtPortOp, enum virNetDevVPortProfileLinkOp virtPortOp,
bool setlink_only) bool setlink_only)
{ {
@ -1010,9 +1010,9 @@ cleanup:
/* Returns 0 on success, -1 on general failure, and -2 on timeout */ /* Returns 0 on success, -1 on general failure, and -2 on timeout */
static int static int
virNetDevVPortProfileOp8021Qbh(const char *ifname, virNetDevVPortProfileOp8021Qbh(const char *ifname,
const virMacAddrPtr macaddr, const virMacAddr *macaddr,
int32_t vf, int32_t vf,
const virNetDevVPortProfilePtr virtPort, const virNetDevVPortProfile *virtPort,
const unsigned char *vm_uuid, const unsigned char *vm_uuid,
enum virNetDevVPortProfileLinkOp virtPortOp) enum virNetDevVPortProfileLinkOp virtPortOp)
{ {
@ -1131,8 +1131,8 @@ cleanup:
*/ */
int int
virNetDevVPortProfileAssociate(const char *macvtap_ifname, virNetDevVPortProfileAssociate(const char *macvtap_ifname,
const virNetDevVPortProfilePtr virtPort, const virNetDevVPortProfile *virtPort,
const virMacAddrPtr macvtap_macaddr, const virMacAddr *macvtap_macaddr,
const char *linkdev, const char *linkdev,
int vf, int vf,
const unsigned char *vmuuid, const unsigned char *vmuuid,
@ -1195,8 +1195,8 @@ virNetDevVPortProfileAssociate(const char *macvtap_ifname,
*/ */
int int
virNetDevVPortProfileDisassociate(const char *macvtap_ifname, virNetDevVPortProfileDisassociate(const char *macvtap_ifname,
const virNetDevVPortProfilePtr virtPort, const virNetDevVPortProfile *virtPort,
const virMacAddrPtr macvtap_macaddr, const virMacAddr *macvtap_macaddr,
const char *linkdev, const char *linkdev,
int vf, int vf,
enum virNetDevVPortProfileOp vmOp) enum virNetDevVPortProfileOp vmOp)
@ -1240,8 +1240,8 @@ virNetDevVPortProfileDisassociate(const char *macvtap_ifname,
#else /* ! WITH_VIRTUALPORT */ #else /* ! WITH_VIRTUALPORT */
int virNetDevVPortProfileAssociate(const char *macvtap_ifname ATTRIBUTE_UNUSED, int virNetDevVPortProfileAssociate(const char *macvtap_ifname ATTRIBUTE_UNUSED,
const virNetDevVPortProfilePtr virtPort ATTRIBUTE_UNUSED, const virNetDevVPortProfile *virtPort ATTRIBUTE_UNUSED,
const virMacAddrPtr macvtap_macaddr ATTRIBUTE_UNUSED, const virMacAddr *macvtap_macaddr ATTRIBUTE_UNUSED,
const char *linkdev ATTRIBUTE_UNUSED, const char *linkdev ATTRIBUTE_UNUSED,
int vf ATTRIBUTE_UNUSED, int vf ATTRIBUTE_UNUSED,
const unsigned char *vmuuid ATTRIBUTE_UNUSED, const unsigned char *vmuuid ATTRIBUTE_UNUSED,
@ -1254,8 +1254,8 @@ int virNetDevVPortProfileAssociate(const char *macvtap_ifname ATTRIBUTE_UNUSED,
} }
int virNetDevVPortProfileDisassociate(const char *macvtap_ifname ATTRIBUTE_UNUSED, int virNetDevVPortProfileDisassociate(const char *macvtap_ifname ATTRIBUTE_UNUSED,
const virNetDevVPortProfilePtr virtPort ATTRIBUTE_UNUSED, const virNetDevVPortProfile *virtPort ATTRIBUTE_UNUSED,
const virMacAddrPtr macvtap_macaddr ATTRIBUTE_UNUSED, const virMacAddr *macvtap_macaddr ATTRIBUTE_UNUSED,
const char *linkdev ATTRIBUTE_UNUSED, const char *linkdev ATTRIBUTE_UNUSED,
int vf ATTRIBUTE_UNUSED, int vf ATTRIBUTE_UNUSED,
enum virNetDevVPortProfileOp vmOp ATTRIBUTE_UNUSED) enum virNetDevVPortProfileOp vmOp ATTRIBUTE_UNUSED)

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009-2012 Red Hat, Inc. * Copyright (C) 2009-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
@ -93,8 +93,8 @@ int virNetDevVPortProfileMerge3(virNetDevVPortProfilePtr *result,
virNetDevVPortProfilePtr fromPortgroup); virNetDevVPortProfilePtr fromPortgroup);
int virNetDevVPortProfileAssociate(const char *ifname, int virNetDevVPortProfileAssociate(const char *ifname,
const virNetDevVPortProfilePtr virtPort, const virNetDevVPortProfile *virtPort,
const virMacAddrPtr macaddr, const virMacAddr *macaddr,
const char *linkdev, const char *linkdev,
int vf, int vf,
const unsigned char *vmuuid, const unsigned char *vmuuid,
@ -104,8 +104,8 @@ int virNetDevVPortProfileAssociate(const char *ifname,
ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_RETURN_CHECK;
int virNetDevVPortProfileDisassociate(const char *ifname, int virNetDevVPortProfileDisassociate(const char *ifname,
const virNetDevVPortProfilePtr virtPort, const virNetDevVPortProfile *virtPort,
const virMacAddrPtr macaddr, const virMacAddr *macaddr,
const char *linkdev, const char *linkdev,
int vf, int vf,
enum virNetDevVPortProfileOp vmOp) enum virNetDevVPortProfileOp vmOp)

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2010-2012 Red Hat, Inc. * Copyright (C) 2010-2013 Red Hat, Inc.
* Copyright (C) 2010-2012 IBM Corporation * Copyright (C) 2010-2012 IBM Corporation
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -610,7 +610,7 @@ error_locked:
int int
virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB, virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB,
virNetlinkEventRemoveCallback removeCB, virNetlinkEventRemoveCallback removeCB,
void *opaque, const virMacAddrPtr macaddr, void *opaque, const virMacAddr *macaddr,
unsigned int protocol) unsigned int protocol)
{ {
size_t i; size_t i;
@ -684,7 +684,7 @@ error:
* Returns -1 if the file handle was not registered, 0 upon success * Returns -1 if the file handle was not registered, 0 upon success
*/ */
int int
virNetlinkEventRemoveClient(int watch, const virMacAddrPtr macaddr, virNetlinkEventRemoveClient(int watch, const virMacAddr *macaddr,
unsigned int protocol) unsigned int protocol)
{ {
size_t i; size_t i;
@ -813,7 +813,7 @@ int virNetlinkEventServiceLocalPid(unsigned int protocol ATTRIBUTE_UNUSED)
int virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB ATTRIBUTE_UNUSED, int virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB ATTRIBUTE_UNUSED,
virNetlinkEventRemoveCallback removeCB ATTRIBUTE_UNUSED, virNetlinkEventRemoveCallback removeCB ATTRIBUTE_UNUSED,
void *opaque ATTRIBUTE_UNUSED, void *opaque ATTRIBUTE_UNUSED,
const virMacAddrPtr macaddr ATTRIBUTE_UNUSED, const virMacAddr *macaddr ATTRIBUTE_UNUSED,
unsigned int protocol ATTRIBUTE_UNUSED) unsigned int protocol ATTRIBUTE_UNUSED)
{ {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
@ -824,7 +824,7 @@ int virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB ATTRIBUTE_UN
* virNetlinkEventRemoveClient: unregister a callback from a netlink monitor * virNetlinkEventRemoveClient: unregister a callback from a netlink monitor
*/ */
int virNetlinkEventRemoveClient(int watch ATTRIBUTE_UNUSED, int virNetlinkEventRemoveClient(int watch ATTRIBUTE_UNUSED,
const virMacAddrPtr macaddr ATTRIBUTE_UNUSED, const virMacAddr *macaddr ATTRIBUTE_UNUSED,
unsigned int protocol ATTRIBUTE_UNUSED) unsigned int protocol ATTRIBUTE_UNUSED)
{ {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));

View File

@ -58,7 +58,9 @@ typedef void (*virNetlinkEventHandleCallback)(struct nlmsghdr *,
bool *handled, bool *handled,
void *opaque); void *opaque);
typedef void (*virNetlinkEventRemoveCallback)(int watch, const virMacAddrPtr macaddr, void *opaque); typedef void (*virNetlinkEventRemoveCallback)(int watch,
const virMacAddr *macaddr,
void *opaque);
/** /**
* stopNetlinkEventServer: stop the monitor to receive netlink messages for libvirtd * stopNetlinkEventServer: stop the monitor to receive netlink messages for libvirtd
@ -90,13 +92,13 @@ int virNetlinkEventServiceLocalPid(unsigned int protocol);
*/ */
int virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB, int virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB,
virNetlinkEventRemoveCallback removeCB, virNetlinkEventRemoveCallback removeCB,
void *opaque, const virMacAddrPtr macaddr, void *opaque, const virMacAddr *macaddr,
unsigned int protocol); unsigned int protocol);
/** /**
* virNetlinkEventRemoveClient: unregister a callback from a netlink monitor * virNetlinkEventRemoveClient: unregister a callback from a netlink monitor
*/ */
int virNetlinkEventRemoveClient(int watch, const virMacAddrPtr macaddr, int virNetlinkEventRemoveClient(int watch, const virMacAddr *macaddr,
unsigned int protocol); unsigned int protocol);
#endif /* __VIR_NETLINK_H__ */ #endif /* __VIR_NETLINK_H__ */