[libvirt] [PATCH] virnetdevmacvlan: Provide stubs for macvlan related functions

Michal Privoznik posted 1 patch 5 years, 2 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/c803e05870f459948efa7dce97682d0169a525f7.1568115484.git.mprivozn@redhat.com
src/util/virnetdevmacvlan.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
[libvirt] [PATCH] virnetdevmacvlan: Provide stubs for macvlan related functions
Posted by Michal Privoznik 5 years, 2 months ago
In recent commit of 3d21ff72e0e the virNetDevMacVLanTapOpen() and
virNetDevMacVLanTapSetup() functions were exported in our private
symbols. But these functions live in an #ifdef so they need a
stub implementation.
Then in 1b46566ee the virNetDevMacVLanIsMacvtap() function was
implemented but again, only for #idef and without stub.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

Pushed under build breaker and trivial rules.

 src/util/virnetdevmacvlan.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index 9a9750f24a..e8a9b052b6 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -1178,6 +1178,13 @@ int virNetDevMacVLanRestartWithVPortProfile(const char *cr_ifname,
 }
 
 #else /* ! WITH_MACVTAP */
+bool virNetDevMacVLanIsMacvtap(const char *ifname ATTRIBUTE_UNUSED)
+{
+    virReportSystemError(ENOSYS, "%s",
+                         _("Cannot create macvlan devices on this platform"));
+    return false;
+}
+
 int virNetDevMacVLanCreate(const char *ifname ATTRIBUTE_UNUSED,
                            const char *type ATTRIBUTE_UNUSED,
                            const virMacAddr *macaddress ATTRIBUTE_UNUSED,
@@ -1197,6 +1204,26 @@ int virNetDevMacVLanDelete(const char *ifname ATTRIBUTE_UNUSED)
     return -1;
 }
 
+int
+virNetDevMacVLanTapOpen(const char *ifname ATTRIBUTE_UNUSED,
+                        int *tapfd ATTRIBUTE_UNUSED,
+                        size_t tapfdSize ATTRIBUTE_UNUSED)
+{
+    virReportSystemError(ENOSYS, "%s",
+                         _("Cannot create macvlan devices on this platform"));
+    return -1;
+}
+
+int
+virNetDevMacVLanTapSetup(int *tapfd ATTRIBUTE_UNUSED,
+                         size_t tapfdSize ATTRIBUTE_UNUSED,
+                         bool vnet_hdr ATTRIBUTE_UNUSED)
+{
+    virReportSystemError(ENOSYS, "%s",
+                         _("Cannot create macvlan devices on this platform"));
+    return -1;
+}
+
 int virNetDevMacVLanCreateWithVPortProfile(const char *ifname ATTRIBUTE_UNUSED,
                                            const virMacAddr *macaddress ATTRIBUTE_UNUSED,
                                            const char *linkdev ATTRIBUTE_UNUSED,
-- 
2.21.0

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