* [PATCH 0/2] qga: illumos fixes
@ 2026-10-15 17:32 Roman Bogorodskiy
2026-10-15 17:32 ` [PATCH 1/2] qga: fix build on illumos Roman Bogorodskiy
2026-10-15 17:32 ` [PATCH 2/2] meson.build: fix getifaddrs() detection " Roman Bogorodskiy
0 siblings, 2 replies; 6+ messages in thread
From: Roman Bogorodskiy @ 2026-10-15 17:32 UTC (permalink / raw)
To: qemu-devel
Cc: pbonzini, marcandre.lureau, berrange, pierrick.bouvier,
michael.roth, kkostiuk, Roman Bogorodskiy
I was testing my other qga patch [1] on illumos
and noticed a couple of issues I addressed to unblock testing.
1: https://patchew.org/QEMU/20261015142342.50436-1-bogorodskiy@gmail.com/
Roman Bogorodskiy (2):
qga: fix build on illumos
meson.build: fix getifaddrs() detection on illumos
meson.build | 2 +-
qga/commands-posix.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] qga: fix build on illumos
2026-10-15 17:32 [PATCH 0/2] qga: illumos fixes Roman Bogorodskiy
@ 2026-10-15 17:32 ` Roman Bogorodskiy
2026-10-28 8:58 ` Kostiantyn Kostiuk
2026-10-15 17:32 ` [PATCH 2/2] meson.build: fix getifaddrs() detection " Roman Bogorodskiy
1 sibling, 1 reply; 6+ messages in thread
From: Roman Bogorodskiy @ 2026-10-15 17:32 UTC (permalink / raw)
To: qemu-devel
Cc: pbonzini, marcandre.lureau, berrange, pierrick.bouvier,
michael.roth, kkostiuk, Roman Bogorodskiy
Currently, build fails on illumos with:
../qga/commands-posix.c: In function 'qmp_guest_get_load':
../qga/commands-posix.c:1408:9: error: implicit declaration of function 'getloadavg' [-Wimplicit-function-declaration]
1408 | if (getloadavg(loadavg, G_N_ELEMENTS(loadavg)) < 0) {
| ^~~~~~~~~~
../qga/commands-posix.c:1408:9: warning: nested extern declaration of 'getloadavg' [-Wnested-externs]
This happens because including <sys/loadavg.h> which is needed
for getloadavg() on illumos is nested under the "#ifdef HAVE_GETIFADDRS"
block, and is not included when HAVE_GETIFADDRS is not defined.
As getloadavg() does not depend on HAVE_GETIFADDRS, include
<sys/loadavg.h> outside of the "#ifdef HAVE_GETIFADDRS".
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
---
qga/commands-posix.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 837e285b6d..f58169b43e 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -16,6 +16,9 @@
#include <sys/utsname.h>
#include <sys/wait.h>
#include <dirent.h>
+#if defined(CONFIG_SOLARIS) && defined(CONFIG_GETLOADAVG)
+#include <sys/loadavg.h>
+#endif
#include "qga-qapi-commands.h"
#include "qapi/error.h"
#include "qemu/host-utils.h"
@@ -43,9 +46,6 @@
#include <net/ethernet.h>
#endif
#ifdef CONFIG_SOLARIS
-#ifdef CONFIG_GETLOADAVG
-#include <sys/loadavg.h>
-#endif
#include <sys/sockio.h>
#endif
#endif
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] meson.build: fix getifaddrs() detection on illumos
2026-10-15 17:32 [PATCH 0/2] qga: illumos fixes Roman Bogorodskiy
2026-10-15 17:32 ` [PATCH 1/2] qga: fix build on illumos Roman Bogorodskiy
@ 2026-10-15 17:32 ` Roman Bogorodskiy
1 sibling, 0 replies; 6+ messages in thread
From: Roman Bogorodskiy @ 2026-10-15 17:32 UTC (permalink / raw)
To: qemu-devel
Cc: pbonzini, marcandre.lureau, berrange, pierrick.bouvier,
michael.roth, kkostiuk, Roman Bogorodskiy
Currently, getifaddrs() fails to get detected on illumos
because it requires linking with libsocket which meson
is not doing.
Fix by adding socket to getifaddrs dependencies. This
unlocks 'guest-network-get-interfaces' implementation
for illumos.
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 432a333f56..20407024fa 100644
--- a/meson.build
+++ b/meson.build
@@ -2644,7 +2644,7 @@ config_host_data.set('CONFIG_TIMERFD', cc.has_function('timerfd_create'))
config_host_data.set('CONFIG_GETLOADAVG', cc.has_function('getloadavg'))
config_host_data.set('CONFIG_ARPA_INET_64', cc.has_function('htonll'))
config_host_data.set('HAVE_COPY_FILE_RANGE', cc.has_function('copy_file_range'))
-config_host_data.set('HAVE_GETIFADDRS', cc.has_function('getifaddrs'))
+config_host_data.set('HAVE_GETIFADDRS', cc.has_function('getifaddrs', dependencies: socket))
config_host_data.set('HAVE_GLIB_WITH_SLICE_ALLOCATOR', glib_has_gslice)
config_host_data.set('HAVE_OPENPTY', cc.has_function('openpty', dependencies: util))
config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul', prefix: osdep_prefix))
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] qga: fix build on illumos
2026-10-15 17:32 ` [PATCH 1/2] qga: fix build on illumos Roman Bogorodskiy
@ 2026-10-28 8:58 ` Kostiantyn Kostiuk
2026-10-28 11:51 ` Roman Bogorodskiy
0 siblings, 1 reply; 6+ messages in thread
From: Kostiantyn Kostiuk @ 2026-10-28 8:58 UTC (permalink / raw)
To: Roman Bogorodskiy
Cc: qemu-devel, pbonzini, marcandre.lureau, berrange,
pierrick.bouvier, michael.roth
[-- Attachment #1: Type: text/plain, Size: 1939 bytes --]
On Thu, Oct 15, 2026 at 8:33 PM Roman Bogorodskiy <bogorodskiy@gmail.com>
wrote:
> Currently, build fails on illumos with:
>
> ../qga/commands-posix.c: In function 'qmp_guest_get_load':
> ../qga/commands-posix.c:1408:9: error: implicit declaration of function
> 'getloadavg' [-Wimplicit-function-declaration]
> 1408 | if (getloadavg(loadavg, G_N_ELEMENTS(loadavg)) < 0) {
> | ^~~~~~~~~~
> ../qga/commands-posix.c:1408:9: warning: nested extern declaration of
> 'getloadavg' [-Wnested-externs]
>
> This happens because including <sys/loadavg.h> which is needed
> for getloadavg() on illumos is nested under the "#ifdef HAVE_GETIFADDRS"
> block, and is not included when HAVE_GETIFADDRS is not defined.
>
> As getloadavg() does not depend on HAVE_GETIFADDRS, include
> <sys/loadavg.h> outside of the "#ifdef HAVE_GETIFADDRS".
>
> Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
> ---
> qga/commands-posix.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 837e285b6d..f58169b43e 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -16,6 +16,9 @@
> #include <sys/utsname.h>
> #include <sys/wait.h>
> #include <dirent.h>
> +#if defined(CONFIG_SOLARIS) && defined(CONFIG_GETLOADAVG)
> +#include <sys/loadavg.h>
> +#endif
> #include "qga-qapi-commands.h"
> #include "qapi/error.h"
> #include "qemu/host-utils.h"
> @@ -43,9 +46,6 @@
> #include <net/ethernet.h>
> #endif
> #ifdef CONFIG_SOLARIS
> -#ifdef CONFIG_GETLOADAVG
> -#include <sys/loadavg.h>
> -#endif
>
What is the difference?
Before commit we check CONFIG_GETLOADAVG inside CONFIG_SOLARIS, so
this is definitly the same that you change CONFIG_GETLOADAVG
&& CONFIG_SOLARIS
Best Regards,
Kostiantyn Kostiuk.
> #include <sys/sockio.h>
> #endif
> #endif
> --
> 2.55.0
>
>
[-- Attachment #2: Type: text/html, Size: 2933 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] qga: fix build on illumos
2026-10-28 8:58 ` Kostiantyn Kostiuk
@ 2026-10-28 11:51 ` Roman Bogorodskiy
2026-10-28 11:56 ` Kostiantyn Kostiuk
0 siblings, 1 reply; 6+ messages in thread
From: Roman Bogorodskiy @ 2026-10-28 11:51 UTC (permalink / raw)
To: Kostiantyn Kostiuk
Cc: qemu-devel, pbonzini, marcandre.lureau, berrange,
pierrick.bouvier, michael.roth
Kostiantyn Kostiuk wrote:
> On Thu, Oct 15, 2026 at 8:33 PM Roman Bogorodskiy <bogorodskiy@gmail.com>
> wrote:
>
> > Currently, build fails on illumos with:
> >
> > ../qga/commands-posix.c: In function 'qmp_guest_get_load':
> > ../qga/commands-posix.c:1408:9: error: implicit declaration of function
> > 'getloadavg' [-Wimplicit-function-declaration]
> > 1408 | if (getloadavg(loadavg, G_N_ELEMENTS(loadavg)) < 0) {
> > | ^~~~~~~~~~
> > ../qga/commands-posix.c:1408:9: warning: nested extern declaration of
> > 'getloadavg' [-Wnested-externs]
> >
> > This happens because including <sys/loadavg.h> which is needed
> > for getloadavg() on illumos is nested under the "#ifdef HAVE_GETIFADDRS"
> > block, and is not included when HAVE_GETIFADDRS is not defined.
> >
> > As getloadavg() does not depend on HAVE_GETIFADDRS, include
> > <sys/loadavg.h> outside of the "#ifdef HAVE_GETIFADDRS".
> >
> > Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
> > ---
> > qga/commands-posix.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> > index 837e285b6d..f58169b43e 100644
> > --- a/qga/commands-posix.c
> > +++ b/qga/commands-posix.c
> > @@ -16,6 +16,9 @@
> > #include <sys/utsname.h>
> > #include <sys/wait.h>
> > #include <dirent.h>
> > +#if defined(CONFIG_SOLARIS) && defined(CONFIG_GETLOADAVG)
> > +#include <sys/loadavg.h>
> > +#endif
> > #include "qga-qapi-commands.h"
> > #include "qapi/error.h"
> > #include "qemu/host-utils.h"
> > @@ -43,9 +46,6 @@
> > #include <net/ethernet.h>
> > #endif
> > #ifdef CONFIG_SOLARIS
> > -#ifdef CONFIG_GETLOADAVG
> > -#include <sys/loadavg.h>
> > -#endif
> >
>
> What is the difference?
>
> Before commit we check CONFIG_GETLOADAVG inside CONFIG_SOLARIS, so
> this is definitly the same that you change CONFIG_GETLOADAVG
> && CONFIG_SOLARIS
The whole include block looks like that:
#ifdef HAVE_GETIFADDRS
#include <arpa/inet.h>
#include <sys/socket.h>
#include <net/if.h>
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(CONFIG_SOLARIS)
#include <net/if_arp.h>
#include <netinet/if_ether.h>
#if !defined(ETHER_ADDR_LEN) && defined(ETHERADDRL)
#define ETHER_ADDR_LEN ETHERADDRL
#endif
#else
#include <net/ethernet.h>
#endif
#ifdef CONFIG_SOLARIS
#ifdef CONFIG_GETLOADAVG
#include <sys/loadavg.h>
#endif
#include <sys/sockio.h>
#endif
#endif
So if HAVE_GETIFADDRS is not defined, we do not include <sys/loadavg.h>,
which we actually need even without HAVE_GETIFADDRS, as shown in the
build error snippet in the commit message.
So the patch fixes the build because it moves out this include outside
of the "#ifdef HAVE_GETIFADDRS".
"CONFIG_GETLOADAVG && CONFIG_SOLARIS" is a cosmetic change so we do not
have 2 layers of checks just for a single header.
>
> Best Regards,
> Kostiantyn Kostiuk.
>
>
>
> > #include <sys/sockio.h>
> > #endif
> > #endif
> > --
> > 2.55.0
> >
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] qga: fix build on illumos
2026-10-28 11:51 ` Roman Bogorodskiy
@ 2026-10-28 11:56 ` Kostiantyn Kostiuk
0 siblings, 0 replies; 6+ messages in thread
From: Kostiantyn Kostiuk @ 2026-10-28 11:56 UTC (permalink / raw)
To: Roman Bogorodskiy
Cc: qemu-devel, pbonzini, marcandre.lureau, berrange,
pierrick.bouvier, michael.roth
[-- Attachment #1: Type: text/plain, Size: 54 bytes --]
Reviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
[-- Attachment #2: Type: text/html, Size: 122 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-28 11:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 17:32 [PATCH 0/2] qga: illumos fixes Roman Bogorodskiy
2026-10-15 17:32 ` [PATCH 1/2] qga: fix build on illumos Roman Bogorodskiy
2026-10-28 8:58 ` Kostiantyn Kostiuk
2026-10-28 11:51 ` Roman Bogorodskiy
2026-10-28 11:56 ` Kostiantyn Kostiuk
2026-10-15 17:32 ` [PATCH 2/2] meson.build: fix getifaddrs() detection " Roman Bogorodskiy
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.