* [PATCH] qga: Add initial OpenBSD support
@ 2022-10-31 4:40 Brad Smith
2022-10-31 8:12 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 3+ messages in thread
From: Brad Smith @ 2022-10-31 4:40 UTC (permalink / raw)
To: Michael Roth, Konstantin Kostiuk; +Cc: qemu-devel
qga: Add initial OpenBSD support
Signed-off-by: Brad Smith <brad@comstyle.com>
---
meson.build | 2 +-
qga/commands-bsd.c | 5 +++++
qga/commands-posix.c | 9 +++++++--
qga/main.c | 4 ++--
4 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/meson.build b/meson.build
index 37737913df..fb69a6a683 100644
--- a/meson.build
+++ b/meson.build
@@ -75,7 +75,7 @@ have_tools = get_option('tools') \
.allowed()
have_ga = get_option('guest_agent') \
.disable_auto_if(not have_system and not have_tools) \
- .require(targetos in ['sunos', 'linux', 'windows', 'freebsd'],
+ .require(targetos in ['sunos', 'linux', 'windows', 'freebsd', 'openbsd'],
error_message: 'unsupported OS for QEMU guest agent') \
.allowed()
have_block = have_system or have_tools
diff --git a/qga/commands-bsd.c b/qga/commands-bsd.c
index 15cade2d4c..4deb3bf580 100644
--- a/qga/commands-bsd.c
+++ b/qga/commands-bsd.c
@@ -21,7 +21,12 @@
#include <sys/ucred.h>
#include <sys/mount.h>
#include <net/if_dl.h>
+#ifdef __OpenBSD__
+#include <net/if_arp.h>
+#include <netinet/if_ether.h>
+#else
#include <net/ethernet.h>
+#endif
#include <paths.h>
#if defined(CONFIG_FSFREEZE) || defined(CONFIG_FSTRIM)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 32493d6383..640f26dc16 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -45,7 +45,12 @@
#include <arpa/inet.h>
#include <sys/socket.h>
#include <net/if.h>
+#ifdef __OpenBSD__
+#include <net/if_arp.h>
+#include <netinet/if_ether.h>
+#else
#include <net/ethernet.h>
+#endif
#include <sys/types.h>
#ifdef CONFIG_SOLARIS
#include <sys/sockio.h>
@@ -2881,7 +2886,7 @@ static int guest_get_network_stats(const char *name,
return -1;
}
-#ifndef __FreeBSD__
+#ifndef CONFIG_BSD
/*
* Fill "buf" with MAC address by ifaddrs. Pointer buf must point to a
* buffer with ETHER_ADDR_LEN length at least.
@@ -2930,7 +2935,7 @@ bool guest_get_hw_addr(struct ifaddrs *ifa, unsigned char *buf,
close(sock);
return true;
}
-#endif /* __FreeBSD__ */
+#endif /* CONFIG_BSD */
/*
* Build information about guest interfaces
diff --git a/qga/main.c b/qga/main.c
index b3580508fa..0fe94e80d1 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -40,9 +40,9 @@
#include "commands-common.h"
#ifndef _WIN32
-#ifdef __FreeBSD__
+#ifdef CONFIG_BSD
#define QGA_VIRTIO_PATH_DEFAULT "/dev/vtcon/org.qemu.guest_agent.0"
-#else /* __FreeBSD__ */
+#else /* CONFIG_BSD */
#define QGA_VIRTIO_PATH_DEFAULT "/dev/virtio-ports/org.qemu.guest_agent.0"
#endif /* __FreeBSD__ */
#define QGA_SERIAL_PATH_DEFAULT "/dev/ttyS0"
--
2.38.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] qga: Add initial OpenBSD support
2022-10-31 4:40 [PATCH] qga: Add initial OpenBSD support Brad Smith
@ 2022-10-31 8:12 ` Philippe Mathieu-Daudé
2022-10-31 11:40 ` Konstantin Kostiuk
0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-10-31 8:12 UTC (permalink / raw)
To: Brad Smith, Michael Roth, Konstantin Kostiuk
Cc: qemu-devel, QEMU Trivial, Marc-André Lureau
On 31/10/22 05:40, Brad Smith wrote:
> qga: Add initial OpenBSD support
>
> Signed-off-by: Brad Smith <brad@comstyle.com>
> ---
> meson.build | 2 +-
> qga/commands-bsd.c | 5 +++++
> qga/commands-posix.c | 9 +++++++--
> qga/main.c | 4 ++--
> 4 files changed, 15 insertions(+), 5 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] qga: Add initial OpenBSD support
2022-10-31 8:12 ` Philippe Mathieu-Daudé
@ 2022-10-31 11:40 ` Konstantin Kostiuk
0 siblings, 0 replies; 3+ messages in thread
From: Konstantin Kostiuk @ 2022-10-31 11:40 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Brad Smith, Michael Roth, qemu-devel, QEMU Trivial,
Marc-André Lureau
[-- Attachment #1: Type: text/plain, Size: 566 bytes --]
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
On Mon, Oct 31, 2022 at 10:12 AM Philippe Mathieu-Daudé <philmd@linaro.org>
wrote:
> On 31/10/22 05:40, Brad Smith wrote:
> > qga: Add initial OpenBSD support
> >
> > Signed-off-by: Brad Smith <brad@comstyle.com>
> > ---
> > meson.build | 2 +-
> > qga/commands-bsd.c | 5 +++++
> > qga/commands-posix.c | 9 +++++++--
> > qga/main.c | 4 ++--
> > 4 files changed, 15 insertions(+), 5 deletions(-)
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
>
[-- Attachment #2: Type: text/html, Size: 1083 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-31 11:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-31 4:40 [PATCH] qga: Add initial OpenBSD support Brad Smith
2022-10-31 8:12 ` Philippe Mathieu-Daudé
2022-10-31 11:40 ` Konstantin Kostiuk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).