qemu: actually enable the improved qemu-ga support for OpenBSD, fix

default paths, and provide an rc-script and pkg-readme showing how to
use it (the qemu instance must be configured to provide guest agent
support on isa rather than the default virtio device). ok landry@
This commit is contained in:
sthen 2022-03-29 10:04:28 +00:00
parent 0a15c5bc11
commit 0cbc4b0051
7 changed files with 67 additions and 5 deletions

View File

@ -5,6 +5,8 @@ COMMENT-main= multi system emulator
COMMENT-ga= QEMU guest agent
VERSION= 6.2.0
REVISION-ga= 0
REVISION-main= 0
DISTNAME= qemu-${VERSION}
CATEGORIES= emulators
MASTER_SITES= https://download.qemu.org/
@ -65,7 +67,7 @@ LIB_DEPENDS-ga= ${LIB_DEPENDS}
MAKE_ENV= V=1
FAKE_FLAGS= qemu_confdir=${PREFIX}/share/examples/qemu
CFLAGS+= -I${LOCALBASE}/include -I${X11BASE}/include
CFLAGS+= -I${LOCALBASE}/include -I${X11BASE}/include -DBSD_GUEST_AGENT
LDFLAGS+= -L${LOCALBASE}/lib -L${X11BASE}/lib
# until the system headers are fixed properly.
@ -75,7 +77,8 @@ SEPARATE_BUILD= Yes
USE_GMAKE= Yes
CONFIGURE_STYLE=simple
CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
CONFIGURE_ARGS= --prefix=${PREFIX} \
CONFIGURE_ARGS= --localstatedir=${LOCALSTATEDIR} \
--prefix=${PREFIX} \
--sysconfdir=${SYSCONFDIR} \
--mandir=${PREFIX}/man \
--python=${MODPY_BIN} \
@ -128,5 +131,7 @@ post-install:
${PREFIX}/share/examples/qemu
${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown \
${PREFIX}/share/examples/qemu
${INSTALL_SCRIPT} ${FILESDIR}/qemu-ga.conf \
${PREFIX}/share/examples/qemu
.include <bsd.port.mk>

View File

@ -0,0 +1,3 @@
[general]
method=isa-serial
path=/dev/cua01

View File

@ -1,4 +1,5 @@
- sndio module
- localstatedir doesn't belong under prefix
- Remove hardcoding of optimization
Index: meson.build
@ -33,6 +34,15 @@ Index: meson.build
(targetos == 'linux' ? [] : [ 'sdl' ])
audio_drivers_default = []
foreach k: audio_drivers_priority
@@ -1418,7 +1424,7 @@ config_host_data.set_quoted('CONFIG_QEMU_FIRMWAREPATH'
config_host_data.set_quoted('CONFIG_QEMU_HELPERDIR', get_option('prefix') / get_option('libexecdir'))
config_host_data.set_quoted('CONFIG_QEMU_ICONDIR', get_option('prefix') / qemu_icondir)
config_host_data.set_quoted('CONFIG_QEMU_LOCALEDIR', get_option('prefix') / get_option('localedir'))
-config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDIR', get_option('prefix') / get_option('localstatedir'))
+config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDIR', get_option('localstatedir'))
config_host_data.set_quoted('CONFIG_QEMU_MODDIR', get_option('prefix') / qemu_moddir)
config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_option('sysconfdir'))
@@ -3234,11 +3240,9 @@ if targetos == 'windows'
endif
endif

View File

@ -1,6 +1,14 @@
@conflict qemu-<=5.1.0p2
@rcscript ${RCDIR}/qemu_ga
@bin bin/qemu-ga
@man man/man7/qemu-ga-ref.7
@man man/man8/qemu-ga.8
share/doc/qemu/
share/doc/qemu/interop/
share/doc/qemu/interop/qemu-ga-ref.html
share/doc/qemu/interop/qemu-ga.html
share/examples/qemu/
@sample ${SYSCONFDIR}/qemu/
share/examples/qemu/qemu-ga.conf
@sample ${SYSCONFDIR}/qemu/qemu-ga.conf
share/doc/pkg-readmes/${PKGSTEM}

View File

@ -48,7 +48,6 @@
@man man/man8/qemu-pr-helper.8
share/applications/qemu.desktop
share/doc/pkg-readmes/${PKGSTEM}
share/doc/qemu/
share/doc/qemu/.buildinfo
share/doc/qemu/_static/
share/doc/qemu/_static/basic.css
@ -141,7 +140,6 @@ share/doc/qemu/devel/vfio-migration.html
share/doc/qemu/devel/writing-monitor-commands.html
share/doc/qemu/genindex.html
share/doc/qemu/index.html
share/doc/qemu/interop/
share/doc/qemu/interop/barrier.html
share/doc/qemu/interop/bitmaps.html
share/doc/qemu/interop/dbus-vmstate.html
@ -289,7 +287,6 @@ share/doc/qemu/tools/virtiofsd.html
share/doc/qemu/user/
share/doc/qemu/user/index.html
share/doc/qemu/user/main.html
share/examples/qemu/
share/examples/qemu/qemu-ifdown
@mode 755
@sample ${SYSCONFDIR}/qemu-ifdown

View File

@ -0,0 +1,25 @@
+-----------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
+-----------------------------------------------------------------------
To use qemu-ga, configure QEMU to present the guest agent interface as
an isa-serial port.
If you use Proxmox Virtual Environment, you can do this in the "Options"
section; edit "QEMU Guest Agent", enable it, tick the box to show advanced
settings, and set "Type" to ISA.
An rc.d(8) script is provided; as usual you can enable it to start at
boot with:
# rcctl enable qemu_ga
By default the script uses /dev/cua01 for the connection as would be
the case where you have also enabled a serial console device. If you have
not done this and the Guest Agent interface is on a different port, set
that with e.g.
# rcctl set qemu_ga flags -t /var/run/qemu-ga \
-f /var/run/qemu-ga/qemu-ga.pid -m isa-serial -p /dev/cua00
Currently only a basic set of commands are available via this interface.

View File

@ -0,0 +1,14 @@
#!/bin/ksh
daemon="${TRUEPREFIX}/bin/qemu-ga -d"
daemon_flags="-t /var/run/qemu-ga -f /var/run/qemu-ga/qemu-ga.pid"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_pre() {
install -d -o ${daemon_user} /var/run/qemu-ga
}
rc_cmd $1