All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/collectd: fix build of virt plugin
@ 2026-08-27 20:08 Thomas Petazzoni via buildroot
  2026-08-28 11:42 ` Julien Olivain via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-08-27 20:08 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Petazzoni

Since the bump of libxml2 from 2.13.8 to 2.15.0 in Buildroot commit
d81922c1ef8825f10b802984d9721412a1a1a377, the "virt" plugin of
collectd no longer builds:

src/virt.c:2208:49: error: expected ';', ',' or ')' before 'ATTRIBUTE_UNUSED'
 2208 | static void virt_eventloop_timeout_cb(int timer ATTRIBUTE_UNUSED,
      |                                                 ^~~~~~~~~~~~~~~~
src/virt.c: In function 'register_event_impl':
src/virt.c:2221:26: error: 'virt_eventloop_timeout_cb' undeclared (first use in this function)
 2221 |                          virt_eventloop_timeout_cb, NULL, NULL) < 0) {
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~
src/virt.c:2221:26: note: each undeclared identifier is reported only once for each function it appears in

This is due to the fact that the virt plugin code was incorrectly
using the ATTRIBUTE_UNUSED define, which was supposed to be an
internal define of libxml2. But it turns out that up to libxml2 2.14.0
and its commit 208f27f9641a59863ce1f7d4992df77f7eb0ea9d, this define
had been made publicly available. It could therefore mistakenly be
used by collectd's virt plugin... until libxml2 was upgraded.

We backport an upstream patch from collectd that fixes the issue.

Fixes:

  https://autobuild.buildroot.net/results/4c8463f0372560f4c3a20b0f67854460f0d1c400/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 ...UTE_UNUSED-for-virt_eventloop_timeou.patch | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 package/collectd/0006-virt-Drop-ATTRIBUTE_UNUSED-for-virt_eventloop_timeou.patch

diff --git a/package/collectd/0006-virt-Drop-ATTRIBUTE_UNUSED-for-virt_eventloop_timeou.patch b/package/collectd/0006-virt-Drop-ATTRIBUTE_UNUSED-for-virt_eventloop_timeou.patch
new file mode 100644
index 0000000000..6cf0a55ba2
--- /dev/null
+++ b/package/collectd/0006-virt-Drop-ATTRIBUTE_UNUSED-for-virt_eventloop_timeou.patch
@@ -0,0 +1,45 @@
+From be6ac1ed28b4842e8f2e54c39a2b3fc48feaf8b2 Mon Sep 17 00:00:00 2001
+From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
+Date: Sun, 26 Oct 2025 18:36:56 +0300
+Subject: [PATCH] virt: Drop ATTRIBUTE_UNUSED for virt_eventloop_timeout_cb
+
+ATTRIBUTE_UNUSED seems to be never was a public part of the libvirt interface
+and leads to the following issue with recent libvirt versions were
+ATTRIBUTE_UNUSED has been renamed to G_GNUC_UNUSED:
+
+src/virt.c:2209:49: error: expected ';', ',' or ')' before 'ATTRIBUTE_UNUSED'
+ 2209 | static void virt_eventloop_timeout_cb(int timer ATTRIBUTE_UNUSED,
+      |                                                 ^~~~~~~~~~~~~~~~
+src/virt.c: In function 'register_event_impl':
+src/virt.c:2222:26: error: 'virt_eventloop_timeout_cb' undeclared (first use in this function)
+ 2222 |                          virt_eventloop_timeout_cb, NULL, NULL) < 0) {
+      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~
+src/virt.c:2222:26: note: each undeclared identifier is reported only once for each function it appears in
+
+Drop ATTRIBUTE_UNUSED here as there is little use from it.
+
+Upstream: https://github.com/collectd/collectd/commit/050877ed952ffc15c849803a9b3e77c5cec15f81
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ src/virt.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/virt.c b/src/virt.c
+index 01c7c777..ee0440e9 100644
+--- a/src/virt.c
++++ b/src/virt.c
+@@ -2205,8 +2205,9 @@ static int domain_lifecycle_event_cb(__attribute__((unused)) virConnectPtr con_,
+   return 0;
+ }
+ 
+-static void virt_eventloop_timeout_cb(int timer ATTRIBUTE_UNUSED,
+-                                      void *timer_info) {}
++static void
++virt_eventloop_timeout_cb(__attribute__((unused)) int timer,
++                          __attribute__((unused)) void *timer_info) {}
+ 
+ static int register_event_impl(void) {
+   if (virEventRegisterDefaultImpl() < 0) {
+-- 
+2.55.0
+
-- 
2.55.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH] package/collectd: fix build of virt plugin
  2026-08-27 20:08 [Buildroot] [PATCH] package/collectd: fix build of virt plugin Thomas Petazzoni via buildroot
@ 2026-08-28 11:42 ` Julien Olivain via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Julien Olivain via buildroot @ 2026-08-28 11:42 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

On 27/08/2026 22:08, Thomas Petazzoni via buildroot wrote:
> Since the bump of libxml2 from 2.13.8 to 2.15.0 in Buildroot commit
> d81922c1ef8825f10b802984d9721412a1a1a377, the "virt" plugin of
> collectd no longer builds:
> 
> src/virt.c:2208:49: error: expected ';', ',' or ')' before 
> 'ATTRIBUTE_UNUSED'
>  2208 | static void virt_eventloop_timeout_cb(int timer 
> ATTRIBUTE_UNUSED,
>       |                                                 
> ^~~~~~~~~~~~~~~~
> src/virt.c: In function 'register_event_impl':
> src/virt.c:2221:26: error: 'virt_eventloop_timeout_cb' undeclared 
> (first use in this function)
>  2221 |                          virt_eventloop_timeout_cb, NULL, NULL) 
> < 0) {
>       |                          ^~~~~~~~~~~~~~~~~~~~~~~~~
> src/virt.c:2221:26: note: each undeclared identifier is reported only 
> once for each function it appears in
> 
> This is due to the fact that the virt plugin code was incorrectly
> using the ATTRIBUTE_UNUSED define, which was supposed to be an
> internal define of libxml2. But it turns out that up to libxml2 2.14.0
> and its commit 208f27f9641a59863ce1f7d4992df77f7eb0ea9d, this define
> had been made publicly available. It could therefore mistakenly be
> used by collectd's virt plugin... until libxml2 was upgraded.
> 
> We backport an upstream patch from collectd that fixes the issue.
> 
> Fixes:
> 
>   
> https://autobuild.buildroot.net/results/4c8463f0372560f4c3a20b0f67854460f0d1c400/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Applied to master, thanks.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-28 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 20:08 [Buildroot] [PATCH] package/collectd: fix build of virt plugin Thomas Petazzoni via buildroot
2026-08-28 11:42 ` Julien Olivain via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.