Thursday, April 08, 2021

Re: [doc] using qemu guest agent on OpenBSD kvm/qemu guests

On 08/04/2021 14:35, Landry Breuil wrote:>
> well that's very nice, definitely interested in those freebsd patches !
> not 100% sure those will get in 6.9 though as we're slowly moving towards
> lock, but send them anyway, and we'll figure out what we can do from
> there. I suppose those come from https://github.com/aborche/qemu-guest-agent ?

Indeed, here they are (if there's interest I can also send a diff of the patches
compared to the FreeBSD patches to see what I've done):

--- qga/Makefile.objs.orig
+++ qga/Makefile.objs
@@ -1,3 +1,5 @@
+CFLAGS += -DBSD_GUEST_AGENT
+
commands-posix.o-libs := $(LIBUDEV_LIBS)
qga-obj-y = commands.o guest-agent-command-state.o main.o
qga-obj-$(CONFIG_POSIX) += commands-posix.o channel-posix.o
--- qga/commands-posix.c.orig
+++ qga/commands-posix.c
@@ -28,6 +28,26 @@
#include "qemu/cutils.h"
#include "commands-common.h"

+#ifdef BSD_GUEST_AGENT
+#include <ifaddrs.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <net/if.h>
+#include <sys/socket.h>
+#include <ifaddrs.h>
+#include <sys/statvfs.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <netinet/if_ether.h>
+#include <net/if_var.h>
+
+#ifdef __OpenBSD__
+#define SIOCGIFLLADDR _IOWR('i', 32, struct ifreq) /* get link level addr */
+#define SIOCGHWADDR SIOCGIFLLADDR
+

No comments:

Post a Comment