[libvirt] [PATCH] Fix build on non-linux platforms after another VIR_AUTOPTR patches

Erik Skultety posted 1 patch 5 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/a741b622368b4cf2382086b94b92e89598b24209.1534244507.git.eskultet@redhat.com
Test syntax-check passed
src/util/virnetlink.h | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
[libvirt] [PATCH] Fix build on non-linux platforms after another VIR_AUTOPTR patches
Posted by Erik Skultety 5 years, 8 months ago
Caused by commit f7d0663d49. The problem is missing libnl library on
these platforms, so the VIR_DEFINE_AUTOPTR_FUNC has to be compiled in
conditionally.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
---

Checked with Travis CI, local fedora with MinGW and FreeBSD, thus pushed under
the build breaker rule.

 src/util/virnetlink.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h
index 136b42b995..1e1e616b41 100644
--- a/src/util/virnetlink.h
+++ b/src/util/virnetlink.h
@@ -36,6 +36,9 @@
 #   undef inline
 #  endif

+typedef struct nl_msg virNetlinkMsg;
+VIR_DEFINE_AUTOPTR_FUNC(virNetlinkMsg, nlmsg_free)
+
 # else

 struct nl_msg;
@@ -45,8 +48,6 @@ struct nlmsghdr;

 # endif /* __linux__ */

-typedef struct nl_msg virNetlinkMsg;
-
 int virNetlinkStartup(void);
 void virNetlinkShutdown(void);

@@ -126,6 +127,4 @@ int virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB,
 int virNetlinkEventRemoveClient(int watch, const virMacAddr *macaddr,
                                 unsigned int protocol);

-VIR_DEFINE_AUTOPTR_FUNC(virNetlinkMsg, nlmsg_free)
-
 #endif /* __VIR_NETLINK_H__ */
--
2.14.4

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