qga: Add initial OpenBSD and NetBSD support
PATCH 1/1 qga: Add initial OpenBSD and NetBSD support
qga: Add initial OpenBSD and NetBSD support
Signed-off-by Brad Smith <[email protected]>
--- meson.build | 2 +- qga/commands-bsd.c | 5 +++++ qga/commands-posix.c | 9 +++++++-- qga/main.c | 6 +++--- 4 files changed, 16 insertions(+), 6 deletions(-)
meson.build +1 -1
@@ -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', 'netbsd', 'openbsd'], error_message: 'unsupported OS for QEMU guest agent') \ .allowed() have_block = have_system or have_tools
qga/commands-bsd.c +5 -0
@@ -21,7 +21,12 @@#include <sys/ucred.h> #include <sys/mount.h> #include <net/if_dl.h> +#if defined(__NetBSD__) || defined(__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 )
qga/commands-posix.c +7 -2
@@ -45,7 +45,12 @@#include <arpa/inet.h> #include <sys/socket.h> #include <net/if.h> +#if defined(__NetBSD__) || defined(__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
qga/main.c +3 -3
@@ -40,11 +40,11 @@#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__ */ +#endif /* CONFIG_BSD */ #define QGA_SERIAL_PATH_DEFAULT "/dev/ttyS0"#define QGA_STATE_RELATIVE_DIR "run"#else
Signature · 1 line
2.38.1
Quoted 9 lines · Brad Smith
qga: Add initial OpenBSD and NetBSD support
Signed-off-by Brad Smith <[email protected]>--- meson.build | 2 +- qga/commands-bsd.c | 5 +++++ qga/commands-posix.c | 9 +++++++-- qga/main.c | 6 +++--- 4 files changed, 16 insertions(+), 6 deletions(-)
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Konstantin Kostiuk
Reviewed-byReviewed-by Konstantin Kostiuk <[email protected]>
Quoted 14 lines · Philippe Mathieu-Daudé
Quoted 9 lines · Brad Smith
qga: Add initial OpenBSD and NetBSD support
Signed-off-by Brad Smith <[email protected]>--- meson.build | 2 +- qga/commands-bsd.c | 5 +++++ qga/commands-posix.c | 9 +++++++-- qga/main.c | 6 +++--- 4 files changed, 16 insertions(+), 6 deletions(-)Reviewed-by Philippe Mathieu-Daudé <[email protected]>
the series was merged
Best Regards,
Konstantin Kostiuk.
Quoted 19 lines · Konstantin Kostiuk
Reviewed-by Konstantin Kostiuk <[email protected]>Quoted 14 lines · Philippe Mathieu-Daudé
Quoted 9 lines · Brad Smith
qga: Add initial OpenBSD and NetBSD support
Signed-off-by Brad Smith <[email protected]>--- meson.build | 2 +- qga/commands-bsd.c | 5 +++++ qga/commands-posix.c | 9 +++++++-- qga/main.c | 6 +++--- 4 files changed, 16 insertions(+), 6 deletions(-)Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Quoted 1 line · Konstantin Kostiuk
the series was merged
Thank you.