]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: make a couple virNetDevMacVlan*() functions public
authorLaine Stump <laine@redhat.com>
Mon, 26 Aug 2019 05:51:40 +0000 (01:51 -0400)
committerLaine Stump <laine@redhat.com>
Mon, 9 Sep 2019 18:31:55 +0000 (14:31 -0400)
In virNetDevMacVLanOpen(), The "retries" arg has been removed and the
value hardcoded as 10, since previously the function was only called
from one place, so it was always 10.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/libvirt_private.syms
src/util/virnetdevmacvlan.c
src/util/virnetdevmacvlan.h

index 7adb07aac07b7db96c5addc9209ecee8637b55db..0ee2014beb8ca2fcc8dba2a60f62c5d013bb3589 100644 (file)
@@ -2529,6 +2529,8 @@ virNetDevMacVLanModeTypeFromString;
 virNetDevMacVLanReleaseName;
 virNetDevMacVLanReserveName;
 virNetDevMacVLanRestartWithVPortProfile;
+virNetDevMacVLanTapOpen;
+virNetDevMacVLanTapSetup;
 virNetDevMacVLanVPortProfileRegisterCallback;
 
 
index 79aa7ed5ac7e1c1df4608a24d89c3ac7adf87c99..9a9750f24a1c532f6940e27db5729fc890d5ada4 100644 (file)
@@ -374,19 +374,17 @@ int virNetDevMacVLanDelete(const char *ifname)
  * @ifname: Name of the macvtap interface
  * @tapfd: array of file descriptor return value for the new macvtap device
  * @tapfdSize: number of file descriptors in @tapfd
- * @retries : Number of retries in case udev for example may need to be
- *            waited for to create the tap chardev
  *
  * Open the macvtap's tap device, possibly multiple times if @tapfdSize > 1.
  *
  * Returns 0 on success, -1 otherwise.
  */
-static int
+int
 virNetDevMacVLanTapOpen(const char *ifname,
                         int *tapfd,
-                        size_t tapfdSize,
-                        int retries)
+                        size_t tapfdSize)
 {
+    int retries = 10;
     int ret = -1;
     int ifindex;
     size_t i = 0;
@@ -446,7 +444,7 @@ virNetDevMacVLanTapOpen(const char *ifname,
  *
  * Returns 0 on success, -1 in case of fatal error.
  */
-static int
+int
 virNetDevMacVLanTapSetup(int *tapfd, size_t tapfdSize, bool vnet_hdr)
 {
     unsigned int features;
@@ -1040,7 +1038,7 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifnameRequested,
     }
 
     if (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) {
-        if (virNetDevMacVLanTapOpen(ifnameCreated, tapfd, tapfdSize, 10) < 0)
+        if (virNetDevMacVLanTapOpen(ifnameCreated, tapfd, tapfdSize) < 0)
             goto disassociate_exit;
 
         if (virNetDevMacVLanTapSetup(tapfd, tapfdSize, vnet_hdr) < 0)
index 8ac7643e49607e046fa718559178afd7d3e258ca..24b17b4bd01e818f745efeb7a3f1b3900e0b9e25 100644 (file)
@@ -88,6 +88,15 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
     ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(6)
     ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(10) ATTRIBUTE_RETURN_CHECK;
 
+int virNetDevMacVLanTapOpen(const char *ifname,
+                            int *tapfd,
+                            size_t tapfdSize)
+   ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
+   ATTRIBUTE_RETURN_CHECK;
+
+int virNetDevMacVLanTapSetup(int *tapfd, size_t tapfdSize, bool vnet_hdr)
+   ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
+
 int virNetDevMacVLanDeleteWithVPortProfile(const char *ifname,
                                            const virMacAddr *macaddress,
                                            const char *linkdev,