[PATCH 04/15] maint: avoid 'const fooPtr' in virnet files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



'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@xxxxxxxxxx>
---
 src/util/virnetdev.c             | 20 ++++++++++----------
 src/util/virnetdev.h             |  8 ++++----
 src/util/virnetdevbandwidth.c    |  6 +++---
 src/util/virnetdevbandwidth.h    |  7 ++++---
 src/util/virnetdevmacvlan.c      | 22 +++++++++++-----------
 src/util/virnetdevmacvlan.h      | 12 ++++++------
 src/util/virnetdevopenvswitch.c  |  3 ++-
 src/util/virnetdevopenvswitch.h  |  3 ++-
 src/util/virnetdevtap.c          |  2 +-
 src/util/virnetdevtap.h          |  4 ++--
 src/util/virnetdevvlan.c         |  6 +++---
 src/util/virnetdevvlan.h         |  6 +++---
 src/util/virnetdevvportprofile.c | 28 ++++++++++++++--------------
 src/util/virnetdevvportprofile.h | 10 +++++-----
 src/util/virnetlink.c            | 10 +++++-----
 src/util/virnetlink.h            |  8 +++++---
 16 files changed, 80 insertions(+), 75 deletions(-)

diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 8eb4d4c..441b171 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -165,7 +165,7 @@ int virNetDevExists(const char *ifname)
  * Returns 0 in case of success or -1 on failure
  */
 int virNetDevSetMAC(const char *ifname,
-                    const virMacAddrPtr macaddr)
+                    const virMacAddr *macaddr)
 {
     int fd = -1;
     int ret = -1;
@@ -200,7 +200,7 @@ cleanup:
 #elif defined(SIOCSIFLLADDR) && defined(HAVE_STRUCT_IFREQ) && \
     HAVE_DECL_LINK_ADDR
 int virNetDevSetMAC(const char *ifname,
-                    const virMacAddrPtr macaddr)
+                    const virMacAddr *macaddr)
 {
         struct ifreq ifr;
         struct sockaddr_dl sdl;
@@ -233,7 +233,7 @@ cleanup:
 }
 #else
 int virNetDevSetMAC(const char *ifname,
-                    const virMacAddrPtr macaddr ATTRIBUTE_UNUSED)
+                    const virMacAddr *macaddr ATTRIBUTE_UNUSED)
 {
     virReportSystemError(ENOSYS,
                          _("Cannot set interface MAC on '%s'"),
@@ -302,7 +302,7 @@ int virNetDevGetMAC(const char *ifname,
  */
 int
 virNetDevReplaceMacAddress(const char *linkdev,
-                           const virMacAddrPtr macaddress,
+                           const virMacAddr *macaddress,
                            const char *stateDir)
 {
     virMacAddr oldmac;
@@ -1002,7 +1002,7 @@ int virNetDevGetIPv4Address(const char *ifname ATTRIBUTE_UNUSED,
  */
 #if defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ)
 int virNetDevValidateConfig(const char *ifname,
-                            const virMacAddrPtr macaddr, int ifindex)
+                            const virMacAddr *macaddr, int ifindex)
 {
     int fd = -1;
     int ret = -1;
@@ -1056,7 +1056,7 @@ int virNetDevValidateConfig(const char *ifname,
 }
 #else
 int virNetDevValidateConfig(const char *ifname ATTRIBUTE_UNUSED,
-                            const virMacAddrPtr macaddr ATTRIBUTE_UNUSED,
+                            const virMacAddr *macaddr ATTRIBUTE_UNUSED,
                             int ifindex ATTRIBUTE_UNUSED)
 {
     virReportSystemError(ENOSYS, "%s",
@@ -1461,7 +1461,7 @@ buffer_too_small:

 static int
 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 rc = -1;
@@ -1655,7 +1655,7 @@ virNetDevGetVfConfig(const char *ifname, int vf, virMacAddrPtr mac,

 static int
 virNetDevReplaceVfConfig(const char *pflinkdev, int vf,
-                         const virMacAddrPtr macaddress,
+                         const virMacAddr *macaddress,
                          int vlanid,
                          const char *stateDir)
 {
@@ -1759,7 +1759,7 @@ cleanup:
  */
 int
 virNetDevReplaceNetConfig(char *linkdev, int vf,
-                          const virMacAddrPtr macaddress, int vlanid,
+                          const virMacAddr *macaddress, int vlanid,
                           char *stateDir)
 {
     if (vf == -1)
@@ -1804,7 +1804,7 @@ virNetDevLinkDump(const char *ifname ATTRIBUTE_UNUSED,
 int
 virNetDevReplaceNetConfig(char *linkdev ATTRIBUTE_UNUSED,
                           int vf ATTRIBUTE_UNUSED,
-                          const virMacAddrPtr macaddress ATTRIBUTE_UNUSED,
+                          const virMacAddr *macaddress ATTRIBUTE_UNUSED,
                           int vlanid ATTRIBUTE_UNUSED,
                           char *stateDir ATTRIBUTE_UNUSED)
 {
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index 44a37ca..8e9ee2d 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -70,14 +70,14 @@ int virNetDevGetIPv4Address(const char *ifname, virSocketAddrPtr addr)


 int virNetDevSetMAC(const char *ifname,
-                    const virMacAddrPtr macaddr)
+                    const virMacAddr *macaddr)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
 int virNetDevGetMAC(const char *ifname,
                     virMacAddrPtr macaddr)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;

 int virNetDevReplaceMacAddress(const char *linkdev,
-                               const virMacAddrPtr macaddress,
+                               const virMacAddr *macaddress,
                                const char *stateDir)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
     ATTRIBUTE_RETURN_CHECK;
@@ -107,7 +107,7 @@ int virNetDevGetVLanID(const char *ifname, int *vlanid)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;

 int virNetDevValidateConfig(const char *ifname,
-                            const virMacAddrPtr macaddr, int ifindex)
+                            const virMacAddr *macaddr, int ifindex)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;

 int virNetDevIsVirtualFunction(const char *ifname)
@@ -134,7 +134,7 @@ int virNetDevLinkDump(const char *ifname, int ifindex,
     ATTRIBUTE_RETURN_CHECK;

 int virNetDevReplaceNetConfig(char *linkdev, int vf,
-                              const virMacAddrPtr macaddress, int vlanid,
+                              const virMacAddr *macaddress, int vlanid,
                               char *stateDir)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(5);

diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c
index 17f4fa3..317aa21 100644
--- a/src/util/virnetdevbandwidth.c
+++ b/src/util/virnetdevbandwidth.c
@@ -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
  * modify it under the terms of the GNU Lesser General Public
@@ -287,7 +287,7 @@ virNetDevBandwidthClear(const char *ifname)
  */
 int
 virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest,
-                       const virNetDevBandwidthPtr src)
+                       const virNetDevBandwidth *src)
 {
     int ret = -1;

@@ -386,7 +386,7 @@ virNetDevBandwidthEqual(virNetDevBandwidthPtr a,
 int
 virNetDevBandwidthPlug(const char *brname,
                        virNetDevBandwidthPtr net_bandwidth,
-                       const virMacAddrPtr ifmac_ptr,
+                       const virMacAddr *ifmac_ptr,
                        virNetDevBandwidthPtr bandwidth,
                        unsigned int id)
 {
diff --git a/src/util/virnetdevbandwidth.h b/src/util/virnetdevbandwidth.h
index 01a2ba5..4606a07 100644
--- a/src/util/virnetdevbandwidth.h
+++ b/src/util/virnetdevbandwidth.h
@@ -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
  * 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;
 int virNetDevBandwidthClear(const char *ifname)
     ATTRIBUTE_NONNULL(1);
-int virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest, const virNetDevBandwidthPtr src)
+int virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest,
+                           const virNetDevBandwidth *src)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;

 bool virNetDevBandwidthEqual(virNetDevBandwidthPtr a, virNetDevBandwidthPtr b);

 int virNetDevBandwidthPlug(const char *brname,
                            virNetDevBandwidthPtr net_bandwidth,
-                           const virMacAddrPtr ifmac_ptr,
+                           const virMacAddr *ifmac_ptr,
                            virNetDevBandwidthPtr bandwidth,
                            unsigned int id)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index d630dff..77cbd6d 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -104,7 +104,7 @@ VIR_ONCE_GLOBAL_INIT(virNetDevMacVLanCreateMutex);
 int
 virNetDevMacVLanCreate(const char *ifname,
                        const char *type,
-                       const virMacAddrPtr macaddress,
+                       const virMacAddr *macaddress,
                        const char *srcdev,
                        uint32_t macvlan_mode,
                        int *retry)
@@ -746,7 +746,7 @@ virNetlinkCallbackDataFree(virNetlinkCallbackDataPtr calld)
  */
 static void
 virNetDevMacVLanVPortProfileDestroyCallback(int watch ATTRIBUTE_UNUSED,
-                                            const virMacAddrPtr macaddr ATTRIBUTE_UNUSED,
+                                            const virMacAddr *macaddr ATTRIBUTE_UNUSED,
                                             void *opaque)
 {
     virNetlinkCallbackDataFree((virNetlinkCallbackDataPtr)opaque);
@@ -754,7 +754,7 @@ virNetDevMacVLanVPortProfileDestroyCallback(int watch ATTRIBUTE_UNUSED,

 int
 virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
-                                             const virMacAddrPtr macaddress,
+                                             const virMacAddr *macaddress,
                                              const char *linkdev,
                                              const unsigned char *vmuuid,
                                              virNetDevVPortProfilePtr virtPortProfile,
@@ -811,7 +811,7 @@ error:
  * otherwise returns 0; returns -1 on error.
  */
 int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
-                                           const virMacAddrPtr macaddress,
+                                           const virMacAddr *macaddress,
                                            const char *linkdev,
                                            enum virNetDevMacVLanMode mode,
                                            bool withTap,
@@ -985,7 +985,7 @@ link_del_exit:
  * were provided.
  */
 int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
-                                           const virMacAddrPtr macaddr,
+                                           const virMacAddr *macaddr,
                                            const char *linkdev,
                                            int mode,
                                            virNetDevVPortProfilePtr virtPortProfile,
@@ -1030,7 +1030,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
  * Returns 0; returns -1 on error.
  */
 int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
-                                           const virMacAddrPtr macaddress,
+                                           const virMacAddr *macaddress,
                                            const char *linkdev,
                                            const unsigned char *vmuuid,
                                            virNetDevVPortProfilePtr virtPortProfile,
@@ -1060,7 +1060,7 @@ error:
 #else /* ! WITH_MACVTAP */
 int virNetDevMacVLanCreate(const char *ifname ATTRIBUTE_UNUSED,
                            const char *type ATTRIBUTE_UNUSED,
-                           const virMacAddrPtr macaddress ATTRIBUTE_UNUSED,
+                           const virMacAddr *macaddress ATTRIBUTE_UNUSED,
                            const char *srcdev ATTRIBUTE_UNUSED,
                            uint32_t macvlan_mode ATTRIBUTE_UNUSED,
                            int *retry ATTRIBUTE_UNUSED)
@@ -1078,7 +1078,7 @@ int virNetDevMacVLanDelete(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,
                                            enum virNetDevMacVLanMode mode ATTRIBUTE_UNUSED,
                                            bool withTap ATTRIBUTE_UNUSED,
@@ -1096,7 +1096,7 @@ int virNetDevMacVLanCreateWithVPortProfile(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,
                                            int mode 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,
-                                           const virMacAddrPtr macaddress ATTRIBUTE_UNUSED,
+                                           const virMacAddr *macaddress ATTRIBUTE_UNUSED,
                                            const char *linkdev ATTRIBUTE_UNUSED,
                                            const unsigned char *vmuuid 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,
-                                             const virMacAddrPtr macaddress ATTRIBUTE_UNUSED,
+                                             const virMacAddr *macaddress ATTRIBUTE_UNUSED,
                                              const char *linkdev ATTRIBUTE_UNUSED,
                                              const unsigned char *vmuuid ATTRIBUTE_UNUSED,
                                              virNetDevVPortProfilePtr virtPortProfile ATTRIBUTE_UNUSED,
diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h
index e44651d..225ddba 100644
--- a/src/util/virnetdevmacvlan.h
+++ b/src/util/virnetdevmacvlan.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Red Hat, Inc.
+ * Copyright (C) 2011, 2013 Red Hat, Inc.
  * Copyright (C) 2010 IBM Corporation
  *
  * This library is free software; you can redistribute it and/or
@@ -42,7 +42,7 @@ VIR_ENUM_DECL(virNetDevMacVLanMode)

 int virNetDevMacVLanCreate(const char *ifname,
                            const char *type,
-                           const virMacAddrPtr macaddress,
+                           const virMacAddr *macaddress,
                            const char *srcdev,
                            uint32_t macvlan_mode,
                            int *retry)
@@ -53,7 +53,7 @@ int virNetDevMacVLanDelete(const char *ifname)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;

 int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
-                                           const virMacAddrPtr macaddress,
+                                           const virMacAddr *macaddress,
                                            const char *linkdev,
                                            enum virNetDevMacVLanMode mode,
                                            bool withTap,
@@ -68,7 +68,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
     ATTRIBUTE_NONNULL(9) ATTRIBUTE_NONNULL(11) ATTRIBUTE_RETURN_CHECK;

 int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
-                                           const virMacAddrPtr macaddress,
+                                           const virMacAddr *macaddress,
                                            const char *linkdev,
                                            int mode,
                                            virNetDevVPortProfilePtr virtPortProfile,
@@ -77,7 +77,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
     ATTRIBUTE_NONNULL(6) ATTRIBUTE_RETURN_CHECK;

 int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
-                                           const virMacAddrPtr macaddress,
+                                           const virMacAddr *macaddress,
                                            const char *linkdev,
                                            const unsigned char *vmuuid,
                                            virNetDevVPortProfilePtr virtPortProfile,
@@ -86,7 +86,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
     ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;

 int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
-                                             const virMacAddrPtr macaddress,
+                                             const virMacAddr *macaddress,
                                              const char *linkdev,
                                              const unsigned char *vmuuid,
                                              virNetDevVPortProfilePtr virtPortProfile,
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index daa2bfa..b4feb1e 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2013 Red Hat, Inc.
  * Copyright (C) 2012 Nicira, Inc.
  *
  * 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.
  */
 int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
-                                   const virMacAddrPtr macaddr,
+                                   const virMacAddr *macaddr,
                                    const unsigned char *vmuuid,
                                    virNetDevVPortProfilePtr ovsport,
                                    virNetDevVlanPtr virtVlan)
diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitch.h
index 0852e4d..131be73 100644
--- a/src/util/virnetdevopenvswitch.h
+++ b/src/util/virnetdevopenvswitch.h
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2013 Red Hat, Inc.
  * Copyright (C) 2012 Nicira, Inc.
  *
  * This library is free software; you can redistribute it and/or
@@ -31,7 +32,7 @@

 int virNetDevOpenvswitchAddPort(const char *brname,
                                 const char *ifname,
-                                const virMacAddrPtr macaddr,
+                                const virMacAddr *macaddr,
                                 const unsigned char *vmuuid,
                                 virNetDevVPortProfilePtr ovsport,
                                 virNetDevVlanPtr virtVlan)
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index fb173e3..ebfc4d4 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -435,7 +435,7 @@ int virNetDevTapDelete(const char *ifname ATTRIBUTE_UNUSED)
  */
 int virNetDevTapCreateInBridgePort(const char *brname,
                                    char **ifname,
-                                   const virMacAddrPtr macaddr,
+                                   const virMacAddr *macaddr,
                                    const unsigned char *vmuuid,
                                    int *tapfd,
                                    int tapfdSize,
diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h
index cb6c284..a762b31 100644
--- a/src/util/virnetdevtap.h
+++ b/src/util/virnetdevtap.h
@@ -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
  * modify it under the terms of the GNU Lesser General Public
@@ -53,7 +53,7 @@ typedef enum {

 int virNetDevTapCreateInBridgePort(const char *brname,
                                    char **ifname,
-                                   const virMacAddrPtr macaddr,
+                                   const virMacAddr *macaddr,
                                    const unsigned char *vmuuid,
                                    int *tapfd,
                                    int tapfdSize,
diff --git a/src/util/virnetdevvlan.c b/src/util/virnetdevvlan.c
index 13ddf36..4c8bce5 100644
--- a/src/util/virnetdevvlan.c
+++ b/src/util/virnetdevvlan.c
@@ -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
  * modify it under the terms of the GNU Lesser General Public
@@ -46,7 +46,7 @@ virNetDevVlanFree(virNetDevVlanPtr vlan)
 }

 int
-virNetDevVlanEqual(const virNetDevVlanPtr a, const virNetDevVlanPtr b)
+virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b)
 {
     int ai, bi;

@@ -81,7 +81,7 @@ virNetDevVlanEqual(const virNetDevVlanPtr a, const virNetDevVlanPtr b)
  *                     dst is assumed to be empty on entry.
  */
 int
-virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlanPtr src)
+virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src)
 {
     if (!src || src->nTags == 0)
         return 0;
diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h
index fd1762a..7f63626 100644
--- a/src/util/virnetdevvlan.h
+++ b/src/util/virnetdevvlan.h
@@ -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
  * modify it under the terms of the GNU Lesser General Public
@@ -45,7 +45,7 @@ struct _virNetDevVlan {

 void virNetDevVlanClear(virNetDevVlanPtr vlan);
 void virNetDevVlanFree(virNetDevVlanPtr vlan);
-int virNetDevVlanEqual(const virNetDevVlanPtr a, const virNetDevVlanPtr b);
-int virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlanPtr src);
+int virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b);
+int virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src);

 #endif /* __VIR_NETDEV_VLAN_H__ */
diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c
index 07155b9..ecebf66 100644
--- a/src/util/virnetdevvportprofile.c
+++ b/src/util/virnetdevvportprofile.c
@@ -577,7 +577,7 @@ cleanup:
 static int
 virNetDevVPortProfileOpSetLink(const char *ifname, int ifindex,
                                bool nltarget_kernel,
-                               const virMacAddrPtr macaddr,
+                               const virMacAddr *macaddr,
                                int vlanid,
                                const char *profileId,
                                struct ifla_port_vsi *portVsi,
@@ -822,7 +822,7 @@ virNetDevVPortProfileGetNthParent(const char *ifname, int ifindex, unsigned int
 static int
 virNetDevVPortProfileOpCommon(const char *ifname, int ifindex,
                               bool nltarget_kernel,
-                              const virMacAddrPtr macaddr,
+                              const virMacAddr *macaddr,
                               int vlanid,
                               const char *profileId,
                               struct ifla_port_vsi *portVsi,
@@ -936,9 +936,9 @@ virNetDevVPortProfileGetPhysdevAndVlan(const char *ifname, int *root_ifindex, ch
 /* Returns 0 on success, -1 on general failure, and -2 on timeout */
 static int
 virNetDevVPortProfileOp8021Qbg(const char *ifname,
-                               const virMacAddrPtr macaddr,
+                               const virMacAddr *macaddr,
                                int vf,
-                               const virNetDevVPortProfilePtr virtPort,
+                               const virNetDevVPortProfile *virtPort,
                                enum virNetDevVPortProfileLinkOp virtPortOp,
                                bool setlink_only)
 {
@@ -1004,9 +1004,9 @@ cleanup:
 /* Returns 0 on success, -1 on general failure, and -2 on timeout */
 static int
 virNetDevVPortProfileOp8021Qbh(const char *ifname,
-                               const virMacAddrPtr macaddr,
+                               const virMacAddr *macaddr,
                                int32_t vf,
-                               const virNetDevVPortProfilePtr virtPort,
+                               const virNetDevVPortProfile *virtPort,
                                const unsigned char *vm_uuid,
                                enum virNetDevVPortProfileLinkOp virtPortOp)
 {
@@ -1125,8 +1125,8 @@ cleanup:
  */
 int
 virNetDevVPortProfileAssociate(const char *macvtap_ifname,
-                               const virNetDevVPortProfilePtr virtPort,
-                               const virMacAddrPtr macvtap_macaddr,
+                               const virNetDevVPortProfile *virtPort,
+                               const virMacAddr *macvtap_macaddr,
                                const char *linkdev,
                                int vf,
                                const unsigned char *vmuuid,
@@ -1189,8 +1189,8 @@ virNetDevVPortProfileAssociate(const char *macvtap_ifname,
  */
 int
 virNetDevVPortProfileDisassociate(const char *macvtap_ifname,
-                                  const virNetDevVPortProfilePtr virtPort,
-                                  const virMacAddrPtr macvtap_macaddr,
+                                  const virNetDevVPortProfile *virtPort,
+                                  const virMacAddr *macvtap_macaddr,
                                   const char *linkdev,
                                   int vf,
                                   enum virNetDevVPortProfileOp vmOp)
@@ -1234,8 +1234,8 @@ virNetDevVPortProfileDisassociate(const char *macvtap_ifname,

 #else /* ! WITH_VIRTUALPORT */
 int virNetDevVPortProfileAssociate(const char *macvtap_ifname ATTRIBUTE_UNUSED,
-                               const virNetDevVPortProfilePtr virtPort ATTRIBUTE_UNUSED,
-                               const virMacAddrPtr macvtap_macaddr ATTRIBUTE_UNUSED,
+                               const virNetDevVPortProfile *virtPort ATTRIBUTE_UNUSED,
+                               const virMacAddr *macvtap_macaddr ATTRIBUTE_UNUSED,
                                const char *linkdev ATTRIBUTE_UNUSED,
                                int vf ATTRIBUTE_UNUSED,
                                const unsigned char *vmuuid ATTRIBUTE_UNUSED,
@@ -1248,8 +1248,8 @@ int virNetDevVPortProfileAssociate(const char *macvtap_ifname ATTRIBUTE_UNUSED,
 }

 int virNetDevVPortProfileDisassociate(const char *macvtap_ifname ATTRIBUTE_UNUSED,
-                                      const virNetDevVPortProfilePtr virtPort ATTRIBUTE_UNUSED,
-                                      const virMacAddrPtr macvtap_macaddr ATTRIBUTE_UNUSED,
+                                      const virNetDevVPortProfile *virtPort ATTRIBUTE_UNUSED,
+                                      const virMacAddr *macvtap_macaddr ATTRIBUTE_UNUSED,
                                       const char *linkdev ATTRIBUTE_UNUSED,
                                       int vf ATTRIBUTE_UNUSED,
                                       enum virNetDevVPortProfileOp vmOp ATTRIBUTE_UNUSED)
diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprofile.h
index 940c0e9..3febf3a 100644
--- a/src/util/virnetdevvportprofile.h
+++ b/src/util/virnetdevvportprofile.h
@@ -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
  * modify it under the terms of the GNU Lesser General Public
@@ -93,8 +93,8 @@ int virNetDevVPortProfileMerge3(virNetDevVPortProfilePtr *result,
                                 virNetDevVPortProfilePtr fromPortgroup);

 int virNetDevVPortProfileAssociate(const char *ifname,
-                                   const virNetDevVPortProfilePtr virtPort,
-                                   const virMacAddrPtr macaddr,
+                                   const virNetDevVPortProfile *virtPort,
+                                   const virMacAddr *macaddr,
                                    const char *linkdev,
                                    int vf,
                                    const unsigned char *vmuuid,
@@ -104,8 +104,8 @@ int virNetDevVPortProfileAssociate(const char *ifname,
     ATTRIBUTE_RETURN_CHECK;

 int virNetDevVPortProfileDisassociate(const char *ifname,
-                                      const virNetDevVPortProfilePtr virtPort,
-                                      const virMacAddrPtr macaddr,
+                                      const virNetDevVPortProfile *virtPort,
+                                      const virMacAddr *macaddr,
                                       const char *linkdev,
                                       int vf,
                                       enum virNetDevVPortProfileOp vmOp)
diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index 7b0a638..901df6e 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2012 Red Hat, Inc.
+ * Copyright (C) 2010-2013 Red Hat, Inc.
  * Copyright (C) 2010-2012 IBM Corporation
  *
  * This library is free software; you can redistribute it and/or
@@ -610,7 +610,7 @@ error_locked:
 int
 virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB,
                          virNetlinkEventRemoveCallback removeCB,
-                         void *opaque, const virMacAddrPtr macaddr,
+                         void *opaque, const virMacAddr *macaddr,
                          unsigned int protocol)
 {
     size_t i;
@@ -684,7 +684,7 @@ error:
  * Returns -1 if the file handle was not registered, 0 upon success
  */
 int
-virNetlinkEventRemoveClient(int watch, const virMacAddrPtr macaddr,
+virNetlinkEventRemoveClient(int watch, const virMacAddr *macaddr,
                             unsigned int protocol)
 {
     size_t i;
@@ -813,7 +813,7 @@ int virNetlinkEventServiceLocalPid(unsigned int protocol ATTRIBUTE_UNUSED)
 int virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB ATTRIBUTE_UNUSED,
                              virNetlinkEventRemoveCallback removeCB ATTRIBUTE_UNUSED,
                              void *opaque ATTRIBUTE_UNUSED,
-                             const virMacAddrPtr macaddr ATTRIBUTE_UNUSED,
+                             const virMacAddr *macaddr ATTRIBUTE_UNUSED,
                              unsigned int protocol ATTRIBUTE_UNUSED)
 {
     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
  */
 int virNetlinkEventRemoveClient(int watch ATTRIBUTE_UNUSED,
-                                const virMacAddrPtr macaddr ATTRIBUTE_UNUSED,
+                                const virMacAddr *macaddr ATTRIBUTE_UNUSED,
                                 unsigned int protocol ATTRIBUTE_UNUSED)
 {
     virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h
index 8351000..c478691 100644
--- a/src/util/virnetlink.h
+++ b/src/util/virnetlink.h
@@ -58,7 +58,9 @@ typedef void (*virNetlinkEventHandleCallback)(struct nlmsghdr *,
                                               bool *handled,
                                               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
@@ -90,13 +92,13 @@ int virNetlinkEventServiceLocalPid(unsigned int protocol);
  */
 int virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB,
                              virNetlinkEventRemoveCallback removeCB,
-                             void *opaque, const virMacAddrPtr macaddr,
+                             void *opaque, const virMacAddr *macaddr,
                              unsigned int protocol);

 /**
  * 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);

 #endif /* __VIR_NETLINK_H__ */
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]