From: Roman Bogorodskiy <bogorodskiy@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Roman Bogorodskiy" <bogorodskiy@gmail.com>,
"Kostiantyn Kostiuk" <kkostiuk@redhat.com>,
"Michael Roth" <michael.roth@amd.com>
Subject: [PATCH v2] tests/unit/test-qga: enable on FreeBSD
Date: Tue, 29 Sep 2026 17:01:00 +0200 [thread overview]
Message-ID: <20260929150100.66035-1-bogorodskiy@gmail.com> (raw)
FreeBSD has all necessary commands implemented,
so enable test-qga for it.
Requires only minimal portability fixes for sockets
in connect_qga().
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
Changes since v1:
- Drop SUN_LEN() for 'len' calculation on FreeBSD,
use 'len = sizeof(remote)' on all platforms.
tests/unit/meson.build | 2 +-
tests/unit/test-qga.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index d17435c187..295df1a7eb 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -169,7 +169,7 @@ if have_system
tests += {'test-qdev': [qom, hwcore]}
endif
-if have_ga and host_os == 'linux'
+if have_ga and host_os in ['freebsd', 'linux']
tests += {'test-qga': ['../qtest/libqmp.c', '../qtest/libqtest.c']}
test_deps += {'test-qga': qga}
endif
diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c
index 01ccf826e6..b1c84c188b 100644
--- a/tests/unit/test-qga.c
+++ b/tests/unit/test-qga.c
@@ -18,7 +18,7 @@ typedef struct {
static int connect_qga(char *path)
{
int s, ret, len, i = 0;
- struct sockaddr_un remote;
+ struct sockaddr_un remote = { 0 };
s = socket(AF_UNIX, SOCK_STREAM, 0);
g_assert(s != -1);
@@ -26,7 +26,7 @@ static int connect_qga(char *path)
remote.sun_family = AF_UNIX;
do {
strcpy(remote.sun_path, path);
- len = strlen(remote.sun_path) + sizeof(remote.sun_family);
+ len = sizeof(remote);
ret = connect(s, (struct sockaddr *)&remote, len);
if (ret == -1) {
g_usleep(G_USEC_PER_SEC);
--
2.55.0
next reply other threads:[~2026-09-29 15:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 15:01 Roman Bogorodskiy [this message]
2026-09-29 15:03 ` [PATCH v2] tests/unit/test-qga: enable on FreeBSD Daniel P. Berrangé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260929150100.66035-1-bogorodskiy@gmail.com \
--to=bogorodskiy@gmail.com \
--cc=berrange@redhat.com \
--cc=kkostiuk@redhat.com \
--cc=michael.roth@amd.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.