qga: Add initial OpenBSD and NetBSD support

qga: Add initial OpenBSD and NetBSD support

Signed-off-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
This commit is contained in:
Brad Smith authored and Konstantin Kostiuk committed 2022-12-20 15:54:41 +02:00
1 parent cce910f219
commit 28236ad8d1
4 files changed
+16 -6

No files matched your search

+5
View File
@@ -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)
+7 -2
View File
@@ -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>
@@ -2872,7 +2877,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.
@@ -2921,7 +2926,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
+3 -3
View File
@@ -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