git: 7eac6b77c16b - main - emulators/qemu: Update version 6.2.0=>7.0.0

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sun, 24 Apr 2022 00:43:33 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7eac6b77c16b3a2552a94e0f14e6fcf471e27a9e

commit 7eac6b77c16b3a2552a94e0f14e6fcf471e27a9e
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2022-04-24 00:40:24 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2022-04-24 00:40:24 +0000

    emulators/qemu: Update version 6.2.0=>7.0.0
    
    Users who want to stick with 6.X branch please check UPDATING or use
    qemu6. As previous qemu comes with three flavors: the default with X11
    support, -nox11 without X11 support and -tools which instals only a
    subset of entire qemu.
    
    Relnotes: https://wiki.qemu.org/ChangeLog/7.0
---
 UPDATING                                       |  14 ++
 emulators/qemu/Makefile                        | 274 ++++++++++++++-----------
 emulators/qemu/distinfo                        |   6 +-
 emulators/qemu/files/patch-block_export_fuse.c |  25 ++-
 emulators/qemu/files/patch-meson.build         |  14 +-
 emulators/qemu/files/patch-util_meson.build    |  14 ++
 emulators/qemu/pkg-plist                       |   8 +-
 7 files changed, 215 insertions(+), 140 deletions(-)

diff --git a/UPDATING b/UPDATING
index 8a93551c070f..e2004da5ddab 100644
--- a/UPDATING
+++ b/UPDATING
@@ -5,6 +5,20 @@ they are unavoidable.
 You should get into the habit of checking this file for changes each time
 you update your ports collection, before attempting any port upgrades.
 
+20220424:
+  AFFECTS: users of emulators/qemu
+  AUTHOR: bofh@FreeBSD.org
+
+  emulators/qemu has been updated to 7.0.0. Previous 6.2.X branch has
+  been repocopied to emulators/qemu6. If someone wants to stick with 6.2.X
+  branch please use one of the following command:
+
+  # pkg install qemu6/qemu6-nox11(based on flavor used)
+    or
+  # portmaster -o emulators/qemu6 emulators/qemu
+    or
+  # portupgrade -o emulators/qemu6 emulators/qemu
+
 20220421:
   AFFECTS: users of lang/ruby27
   AUTHOR: yasu@FreeBSD.org
diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile
index 91af05ec4496..f5c5c9e7768e 100644
--- a/emulators/qemu/Makefile
+++ b/emulators/qemu/Makefile
@@ -1,7 +1,7 @@
 # Created by: Juergen Lock <nox@jelal.kn-bremen.de>
 
 PORTNAME=	qemu
-PORTVERSION=	6.2.0
+PORTVERSION=	7.0.0
 CATEGORIES=	emulators
 MASTER_SITES=	https://download.qemu.org/
 DIST_SUBDIR=	qemu/${PORTVERSION}
@@ -11,6 +11,13 @@ COMMENT=	QEMU CPU Emulator ${${FLAVOR}_COMMENT}
 
 LICENSE=	GPLv2
 
+.if ${FLAVOR:U} != tools
+ONLY_FOR_ARCHS=	amd64
+# We need to check if it build with other ARCHS
+# For i386 we have unknown type name 'vm_page_t'
+# ONLY_FOR_ARCHS=	powerpc powerpc64 powerpc64 powerpc64le
+.endif
+
 BUILD_DEPENDS=	bash:shells/bash
 .if ${FLAVOR:U} != tools
 LIB_DEPENDS+=	libfdt.so:sysutils/dtc \
@@ -20,145 +27,178 @@ LIB_DEPENDS+=	libfdt.so:sysutils/dtc \
 LIB_DEPENDS+=	libepoxy.so:graphics/libepoxy
 .endif
 
-FLAVORS=	default nox11 tools
-FLAVOR?=	${FLAVORS:[1]}
-default_CONFLICTS_INSTALL=	qemu5* qemu42 qemu-devel qemu-nox11 qemu-tools qemu-utils
+FLAVORS=			default nox11 tools
+FLAVOR?=			${FLAVORS:[1]}
+default_CONFLICTS_INSTALL=	qemu-devel qemu-nox11 qemu-tools qemu-utils \
+				qemu5* qemu6*
 nox11_PKGNAMESUFFIX=		-nox11
-nox11_CONFLICTS_INSTALL=	qemu5* qemu42 qemu-devel qemu
-nox11_COMMENT=				(without X11)
+nox11_CONFLICTS_INSTALL=	qemu qemu-devel qemu5* qemu6*
+nox11_COMMENT=			(without X11)
 tools_PKGNAMESUFFIX=		-tools
-tools_COMMENT=				(tools only)
-tools_CONFLICTS_INSTALL=	qemu5* qemu42 qemu-devel qemu-nox11 qemu qemu-utils
-tools_DESCR=	${.CURDIR}/pkg-descr-tools
-tools_PLIST=	${.CURDIR}/pkg-plist-tools
+tools_COMMENT=			(tools only)
+tools_CONFLICTS_INSTALL=	qemu qemu-devel qemu-nox11 qemu-utils qemu5* \
+				qemu6*
+tools_DESCR=			${.CURDIR}/pkg-descr-tools
+tools_PLIST=			${.CURDIR}/pkg-plist-tools
 
-USES=	cpe gmake gnome ninja perl5 pkgconfig python:build tar:xz
+USES=		cpe gmake gnome ninja perl5 pkgconfig python:build tar:xz
 USE_GNOME=	glib20
 USE_PERL5=	build
 .if ${FLAVOR:U} != tools
-ONLY_FOR_ARCHS=	amd64 i386 powerpc powerpc64 powerpc64 powerpc64le
 USES+=		iconv:wchar_t
 .endif
 .if (${FLAVOR:U} != nox11 && ${FLAVOR:U} != tools)
 USE_GNOME+=	cairo
 .endif
 
-HAS_CONFIGURE=	yes
-
-OPTIONS_SINGLE=	NCURSES
-OPTIONS_SINGLE_NCURSES=	NCURSES_DEFAULT NCURSES_BASE NCURSES_PORT
-OPTIONS_DEFINE=	SAMBA X11 GTK3 OPENGL GNUTLS SASL JPEG PNG CURL VDE \
-		CDROM_DMA USBREDIR X86_TARGETS STATIC_LINK DOCS ISCSI CAPSTONE DEBUG \
-		STRIP
-OPTIONS_DEFAULT=X11 GTK3 OPENGL GNUTLS SASL JPEG PNG CDROM_DMA CURL NCURSES_DEFAULT VDE
-.if ${FLAVOR:U} == nox11
-OPTIONS_EXCLUDE:=	GTK3 X11
+HAS_CONFIGURE=		yes
+CONFIGURE_ARGS+=	--cc=${CC} \
+			--disable-kvm \
+			--disable-linux-aio \
+			--disable-linux-user \
+			--disable-xen \
+			--extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\" \
+			--extra-ldflags=-L${LOCALBASE}/lib \
+			--extra-ldflags=-L/usr/lib \
+			--localstatedir=/var \
+			--mandir=${PREFIX}/man \
+			--prefix=${PREFIX} \
+			--python=${PYTHON_CMD}
+.if ${FLAVOR:U} != tools
+CONFIGURE_ARGS+=	--enable-fdt=system \
+			--enable-netmap
 .endif
 .if ${FLAVOR:U} == tools
-OPTIONS_EXCLUDE:=	SAMBA X11 GTK3 OPENGL GNUTLS SASL JPEG PNG CURL VDE \
-		CDROM_DMA USBREDIR X86_TARGETS STATIC_LINK ISCSI CAPSTONE DEBUG \
-		NCURSES_DEFAULT NCURSES_BASE NCURSES_PORT NCURSES
-.endif
-OPTIONS_SUB=	yes
-CAPSTONE_DESC=		Disassembly framework support
-CDROM_DMA_DESC=		IDE CDROM DMA
-GNUTLS_DESC=		gnutls dependency (vnc encryption)
-ISCSI_DESC=		libiscsi dependency (iSCSI client for emulated drives)
-JPEG_DESC=		jpeg dependency (vnc lossy compression)
-NCURSES_DEFAULT_DESC=	Depend on ncurses (ports if installed, otherwise base)
-NCURSES_BASE_DESC=	Depend on ncurses in base
-NCURSES_PORT_DESC=	Depend on devel/ncurses in ports
-PNG_DESC=		png dependency (vnc compression)
-SAMBA_DESC=		samba dependency (for -smb)
-SASL_DESC=		cyrus-sasl dependency (vnc encryption)
-STATIC_LINK_DESC=	Statically link the executables
-USBREDIR_DESC=		usb device network redirection (experimental!)
-VDE_DESC=		vde dependency (for vde networking)
-X86_TARGETS_DESC=	Build only x86 system targets
-CAPSTONE_CONFIGURE_ON=	--enable-capstone=system --extra-cflags=-I${LOCALBASE}/include/capstone
-CAPSTONE_CONFIGURE_OFF=	--disable-capstone
-CAPSTONE_LIB_DEPENDS=	libcapstone.so:devel/capstone4
-CURL_CONFIGURE_OFF=	--disable-curl
-CURL_LIB_DEPENDS=	libcurl.so:ftp/curl
-DEBUG_CONFIGURE_ON=	--enable-debug
-DOCS_BUILD_DEPENDS=	sphinx-build:textproc/py-sphinx@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}sphinx_rtd_theme>0:textproc/py-sphinx_rtd_theme@${PY_FLAVOR}
-DOCS_CONFIGURE_ENABLE=	docs
-GNUTLS_CONFIGURE_OFF=	--disable-gnutls
-GNUTLS_LIB_DEPENDS=	libgnutls.so:security/gnutls
-GTK3_CONFIGURE_OFF=	--disable-gtk --disable-vte
-GTK3_LIB_DEPENDS=	libxkbcommon.so:x11/libxkbcommon
-GTK3_USE=	GNOME=gdkpixbuf2,gtk30,vte3 XORG=x11,xext
-GTK3_USES=	gettext gl
-ISCSI_LIB_DEPENDS=	libiscsi.so:net/libiscsi
-ISCSI_CONFIGURE_OFF=	--disable-libiscsi
-JPEG_CONFIGURE_OFF=	--disable-vnc-jpeg
-JPEG_USES=		jpeg
-NCURSES_DEFAULT_USES=	ncurses
-NCURSES_BASE_USES=	ncurses:base
-NCURSES_PORT_USES=	ncurses:port
-OPENGL_CONFIGURE_OFF=	--disable-opengl
-OPENGL_USE=	GL=gbm,gl
-OPENGL_USES=	gl
-PNG_CONFIGURE_OFF=	--disable-vnc-png
-PNG_LIB_DEPENDS=	libpng.so:graphics/png
-SAMBA_CONFIGURE_ON=	--smbd=${LOCALBASE}/sbin/smbd
-SASL_CONFIGURE_OFF=	--disable-vnc-sasl
-SAMBA_USES=		samba:run # smbd
-SASL_LIB_DEPENDS=	libsasl2.so:security/cyrus-sasl2
-STATIC_LINK_CONFIGURE_ON=	--static
-STATIC_LINK_PREVENTS=		GTK3 X11
-STATIC_LINK_PREVENTS_MSG=	X11 ui cannot be built static
-STRIP_CONFIGURE_OFF=	--disable-strip
-USBREDIR_BUILD_DEPENDS=	usbredir>=0.6:net/usbredir
-USBREDIR_CONFIGURE_OFF=	--disable-usb-redir
-USBREDIR_RUN_DEPENDS=	usbredir>=0.6:net/usbredir
-VDE_CONFIGURE_OFF=	--disable-vde
-VDE_LIB_DEPENDS=	libvdeplug.so:net/vde2
-X11_CONFIGURE_ENABLE=	sdl
-X11_USE=	SDL=sdl2 XORG=x11,xext GNOME=gdkpixbuf2
-X11_USES=	sdl
-.if (empty(FLAVOR) || ${FLAVOR:U} == default || ${FLAVOR:U} == nox11) && (${FLAVOR:U} != tools || ${PKGNAMESUFFIX} != "-guest-agent")
-X86_TARGETS_USE_OFF=	XORG=pixman,x11
-X86_TARGETS_USES_OFF=	xorg
-X86_TARGETS_CONFIGURE_ON=	--target-list='i386-softmmu i386-bsd-user x86_64-softmmu x86_64-bsd-user'
+CONFIGURE_ARGS+=	--disable-attr \
+			--disable-blobs \
+			--disable-brlapi \
+			--disable-bzip2 \
+			--disable-cap-ng \
+			--disable-coroutine-pool \
+			--disable-curses \
+			--disable-fdt \
+			--disable-gcrypt \
+			--disable-glusterfs \
+			--disable-guest-agent \
+			--disable-libnfs \
+			--disable-libusb \
+			--disable-lzo \
+			--disable-netmap \
+			--disable-nettle \
+			--disable-numa \
+			--disable-rbd \
+			--disable-rdma \
+			--disable-seccomp \
+			--disable-smartcard \
+			--disable-snappy \
+			--disable-spice \
+			--disable-system \
+			--disable-tpm \
+			--disable-user \
+			--disable-vhost-net \
+			--disable-virtfs \
+			--disable-vnc \
+			--enable-tools
 .endif
 
-PORTDOCS=	.buildinfo _static/* about/* devel/* docs genindex.html \
-		index.html interop/* objects.inv search.html searchindex.js \
-		specs/* system/* tools/* user/*
-
-WITHOUT_CPU_CFLAGS=yes	#to avoid problems with register allocation
 CFLAGS:=	${CFLAGS:C/-fno-tree-vrp//}
-CONFIGURE_ARGS+=--localstatedir=/var --extra-ldflags=-L/usr/lib \
-		--extra-ldflags=-L${LOCALBASE}/lib \
-		--prefix=${PREFIX} --cc=${CC} --disable-kvm \
-		--disable-linux-user --disable-linux-aio --disable-xen \
-		--python=${PYTHON_CMD} --mandir=${PREFIX}/man \
-		--extra-cflags=-I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"\"${PREFIX}\\\"\"
-
-.if ${FLAVOR:U} != tools
-CONFIGURE_ARGS+=--enable-netmap --enable-fdt=system
+WITHOUT_CPU_CFLAGS=	yes #to avoid problems with register allocation
+
+PORTDOCS=	.buildinfo _static/* about/* dbus-dbusindex.html devel/* docs \
+		genindex.html index.html interop/* objects.inv search.html \
+		searchindex.js specs/* system/* tools/* user/*
+
+OPTIONS_DEFINE=			CAPSTONE CDROM_DMA CURL DEBUG DOCS GNUTLS GTK3 \
+				ISCSI JPEG OPENGL PNG SAMBA SASL STATIC_LINK \
+				STRIP USBREDIR VDE X11 X86_TARGETS
+OPTIONS_DEFAULT=		CDROM_DMA CURL GNUTLS GTK3 JPEG NCURSES_DEFAULT \
+				OPENGL PNG SASL VDE X11
+OPTIONS_SINGLE=			NCURSES
+OPTIONS_SINGLE_NCURSES=		NCURSES_BASE NCURSES_DEFAULT NCURSES_PORT
+.if ${FLAVOR:U} == nox11
+OPTIONS_EXCLUDE:=		GTK3 X11
 .endif
 .if ${FLAVOR:U} == tools
-CONFIGURE_ARGS+=--disable-netmap --disable-system --disable-user  \
-			--disable-nettle --disable-gcrypt --disable-curses \
-			--disable-vnc --disable-virtfs --disable-brlapi \
-			--disable-fdt --disable-rdma --disable-guest-agent \
-			--disable-cap-ng --disable-attr \
-			--disable-vhost-net --disable-spice \
-			--disable-rbd --disable-libnfs \
-			--disable-smartcard --disable-libusb \
-			--disable-lzo --disable-snappy \
-			--disable-bzip2 --disable-seccomp \
-			--disable-coroutine-pool --disable-glusterfs \
-			--disable-tpm --disable-numa \
-			--disable-blobs --enable-tools
+OPTIONS_EXCLUDE:=		CAPSTONE CDROM_DMA CURL DEBUG GNUTLS GTK3 ISCSI \
+				JPEG NCURSES NCURSES_BASE NCURSES_DEFAULT \
+				NCURSES_PORT OPENGL PNG SAMBA SASL STATIC_LINK \
+				USBREDIR VDE X11 X86_TARGETS
+.endif
+OPTIONS_SUB=			yes
+CAPSTONE_DESC=			Disassembly framework support
+CDROM_DMA_DESC=			IDE CDROM DMA
+GNUTLS_DESC=			gnutls dependency (vnc encryption)
+ISCSI_DESC=			libiscsi dependency (iSCSI client for emulated drives)
+JPEG_DESC=			jpeg dependency (vnc lossy compression)
+NCURSES_BASE_DESC=		Depend on ncurses in base
+NCURSES_DEFAULT_DESC=		Depend on ncurses (ports if installed, otherwise base)
+NCURSES_PORT_DESC=		Depend on devel/ncurses in ports
+PNG_DESC=			png dependency (vnc compression)
+SAMBA_DESC=			samba dependency (for -smb)
+SASL_DESC=			cyrus-sasl dependency (vnc encryption)
+STATIC_LINK_DESC=		Statically link the executables
+USBREDIR_DESC=			usb device network redirection (experimental!)
+VDE_DESC=			vde dependency (for vde networking)
+X86_TARGETS_DESC=		Build only x86 system targets
+CAPSTONE_LIB_DEPENDS=		libcapstone.so:devel/capstone4
+CAPSTONE_CONFIGURE_ON=		--enable-capstone=system \
+				--extra-cflags=-I${LOCALBASE}/include/capstone
+CAPSTONE_CONFIGURE_OFF=		--disable-capstone
+CURL_LIB_DEPENDS=		libcurl.so:ftp/curl
+CURL_CONFIGURE_OFF=		--disable-curl
+DEBUG_CONFIGURE_ON=		--enable-debug
+DOCS_BUILD_DEPENDS=		${PYTHON_PKGNAMEPREFIX}sphinx_rtd_theme>0:textproc/py-sphinx_rtd_theme@${PY_FLAVOR} \
+				sphinx-build:textproc/py-sphinx@${PY_FLAVOR}
+DOCS_CONFIGURE_ENABLE=		docs
+GNUTLS_LIB_DEPENDS=		libgnutls.so:security/gnutls
+GNUTLS_CONFIGURE_OFF=		--disable-gnutls
+GTK3_LIB_DEPENDS=		libxkbcommon.so:x11/libxkbcommon
+GTK3_USES=			gettext gl
+GTK3_USE=			GNOME=gdkpixbuf2,gtk30,vte3 \
+				XORG=x11,xext
+GTK3_CONFIGURE_OFF=		--disable-gtk \
+				--disable-vte
+ISCSI_LIB_DEPENDS=		libiscsi.so:net/libiscsi
+ISCSI_CONFIGURE_OFF=		--disable-libiscsi
+JPEG_USES=			jpeg
+JPEG_CONFIGURE_OFF=		--disable-vnc-jpeg
+NCURSES_BASE_USES=		ncurses:base
+NCURSES_DEFAULT_USES=		ncurses
+NCURSES_PORT_USES=		ncurses:port
+OPENGL_USES=			gl
+OPENGL_USE=			GL=gbm,gl
+OPENGL_CONFIGURE_OFF=		--disable-opengl
+PNG_LIB_DEPENDS=		libpng.so:graphics/png
+PNG_CONFIGURE_OFF=		--disable-vnc-png
+SAMBA_USES=			samba:run # smbd
+SAMBA_CONFIGURE_ON=		--smbd=${LOCALBASE}/sbin/smbd
+SASL_LIB_DEPENDS=		libsasl2.so:security/cyrus-sasl2
+SASL_CONFIGURE_OFF=		--disable-vnc-sasl
+STATIC_LINK_PREVENTS=		GTK3 X11
+STATIC_LINK_PREVENTS_MSG=	X11 ui cannot be built static
+STATIC_LINK_CONFIGURE_ON=	--static
+STRIP_CONFIGURE_OFF=		--disable-strip
+USBREDIR_BUILD_DEPENDS=		usbredir>=0.6:net/usbredir
+USBREDIR_RUN_DEPENDS=		usbredir>=0.6:net/usbredir
+USBREDIR_CONFIGURE_OFF=		--disable-usb-redir
+VDE_LIB_DEPENDS=		libvdeplug.so:net/vde2
+VDE_CONFIGURE_OFF=		--disable-vde
+X11_USES=			sdl
+X11_USE=			GNOME=gdkpixbuf2 \
+				SDL=sdl2 \
+				XORG=x11,xext
+X11_CONFIGURE_ENABLE=		sdl
+.if (empty(FLAVOR) || ${FLAVOR:U} == default || ${FLAVOR:U} == nox11) && \
+	(${FLAVOR:U} != tools || ${PKGNAMESUFFIX} != "-guest-agent")
+X86_TARGETS_USES_OFF=		xorg
+X86_TARGETS_USE_OFF=		XORG=pixman,x11
+X86_TARGETS_CONFIGURE_ON=	--target-list='i386-softmmu i386-bsd-user x86_64-softmmu x86_64-bsd-user'
 .endif
 
 .include <bsd.port.options.mk>
 
-.if (empty(FLAVOR) || ${FLAVOR:U} == default || ${FLAVOR:U} == nox11) && (${FLAVOR:U} != tools || ${PKGNAMESUFFIX} != "-guest-agent")
+.if (empty(FLAVOR) || ${FLAVOR:U} == default || ${FLAVOR:U} == nox11) && \
+	(${FLAVOR:U} != tools || ${PKGNAMESUFFIX} != "-guest-agent")
 .if ${ARCH} == "amd64"
 MAKE_ARGS+=	ARCH=x86_64
 .endif
diff --git a/emulators/qemu/distinfo b/emulators/qemu/distinfo
index be4bf5295273..e40467f0d5ce 100644
--- a/emulators/qemu/distinfo
+++ b/emulators/qemu/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1639582833
-SHA256 (qemu/6.2.0/qemu-6.2.0.tar.xz) = 68e15d8e45ac56326e0b9a4afa8b49a3dfe8aba3488221d098c84698bca65b45
-SIZE (qemu/6.2.0/qemu-6.2.0.tar.xz) = 115667324
+TIMESTAMP = 1650583782
+SHA256 (qemu/7.0.0/qemu-7.0.0.tar.xz) = f6b375c7951f728402798b0baabb2d86478ca53d44cedbefabbe1c46bf46f839
+SIZE (qemu/7.0.0/qemu-7.0.0.tar.xz) = 125117636
diff --git a/emulators/qemu/files/patch-block_export_fuse.c b/emulators/qemu/files/patch-block_export_fuse.c
index af18e3c3d9f0..5fbb0dd9a040 100644
--- a/emulators/qemu/files/patch-block_export_fuse.c
+++ b/emulators/qemu/files/patch-block_export_fuse.c
@@ -1,14 +1,24 @@
---- block/export/fuse.c.orig	2021-12-10 19:29:04 UTC
+--- block/export/fuse.c.orig	2022-04-22 18:57:58 UTC
 +++ block/export/fuse.c
-@@ -618,47 +618,7 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t 
+@@ -637,12 +637,6 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t 
          return;
      }
  
+-#ifdef CONFIG_FALLOCATE_PUNCH_HOLE
 -    if (mode & FALLOC_FL_KEEP_SIZE) {
 -        length = MIN(length, blk_len - offset);
 -    }
+-#endif /* CONFIG_FALLOCATE_PUNCH_HOLE */
 -
--    if (mode & FALLOC_FL_PUNCH_HOLE) {
+     if (!mode) {
+         /* We can only fallocate at the EOF with a truncate */
+         if (offset < blk_len) {
+@@ -662,44 +656,6 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t 
+         ret = fuse_do_truncate(exp, offset + length, true,
+                                PREALLOC_MODE_FALLOC);
+     }
+-#ifdef CONFIG_FALLOCATE_PUNCH_HOLE
+-    else if (mode & FALLOC_FL_PUNCH_HOLE) {
 -        if (!(mode & FALLOC_FL_KEEP_SIZE)) {
 -            fuse_reply_err(req, EINVAL);
 -            return;
@@ -22,6 +32,7 @@
 -            length -= size;
 -        } while (ret == 0 && length > 0);
 -    }
+-#endif /* CONFIG_FALLOCATE_PUNCH_HOLE */
 -#ifdef CONFIG_FALLOCATE_ZERO_RANGE
 -    else if (mode & FALLOC_FL_ZERO_RANGE) {
 -        if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + length > blk_len) {
@@ -44,8 +55,6 @@
 -        } while (ret == 0 && length > 0);
 -    }
 -#endif /* CONFIG_FALLOCATE_ZERO_RANGE */
--    else if (!mode) {
-+    if (!mode) {
-         /* We can only fallocate at the EOF with a truncate */
-         if (offset < blk_len) {
-             fuse_reply_err(req, EOPNOTSUPP);
+     else {
+         ret = -EOPNOTSUPP;
+     }
diff --git a/emulators/qemu/files/patch-meson.build b/emulators/qemu/files/patch-meson.build
index 5359dd16ef0e..e701a096e957 100644
--- a/emulators/qemu/files/patch-meson.build
+++ b/emulators/qemu/files/patch-meson.build
@@ -1,7 +1,7 @@
---- meson.build.orig	2021-12-10 18:55:23 UTC
+--- meson.build.orig	2022-04-19 19:10:27 UTC
 +++ meson.build
-@@ -1901,14 +1901,10 @@ fdt_opt = get_option('fdt')
- if have_system
+@@ -2505,14 +2505,10 @@ if have_system
+   fdt_opt = get_option('fdt')
    if fdt_opt in ['enabled', 'auto', 'system']
      have_internal = fs.exists(meson.current_source_dir() / 'dtc/libfdt/Makefile.libfdt')
 -    fdt = cc.find_library('fdt', kwargs: static_kwargs,
@@ -11,10 +11,10 @@
 -    if fdt.found() and cc.links('''
 -       #include <libfdt.h>
 -       #include <libfdt_env.h>
--       int main(void) { fdt_check_full(NULL, 0); return 0; }''',
+-       int main(void) { fdt_find_max_phandle(NULL, NULL); return 0; }''',
 -         dependencies: fdt)
-+                                    fdt_opt == 'enabled' )
++                                    fdt_opt == 'enabled')
 +    if fdt.found()
        fdt_opt = 'system'
-     elif have_internal
-       fdt_opt = 'internal'
+     elif fdt_opt == 'system'
+        error('system libfdt requested, but it is too old (1.5.1 or newer required)')
diff --git a/emulators/qemu/files/patch-util_meson.build b/emulators/qemu/files/patch-util_meson.build
new file mode 100644
index 000000000000..590b1f5a0592
--- /dev/null
+++ b/emulators/qemu/files/patch-util_meson.build
@@ -0,0 +1,14 @@
+--- util/meson.build.orig	2022-04-23 11:59:28 UTC
++++ util/meson.build
+@@ -87,10 +87,6 @@ if have_block
+   util_ss.add(files('readline.c'))
+   util_ss.add(files('throttle.c'))
+   util_ss.add(files('timed-average.c'))
+-  if config_host_data.get('CONFIG_INOTIFY1')
+-    util_ss.add(files('filemonitor-inotify.c'))
+-  else
+-    util_ss.add(files('filemonitor-stub.c'))
+-  endif
++  util_ss.add(files('filemonitor-stub.c'))
+   util_ss.add(when: 'CONFIG_LINUX', if_true: files('vfio-helpers.c'))
+ endif
diff --git a/emulators/qemu/pkg-plist b/emulators/qemu/pkg-plist
index badf1fd8c7d4..4cdb2da528e5 100644
--- a/emulators/qemu/pkg-plist
+++ b/emulators/qemu/pkg-plist
@@ -1,6 +1,6 @@
 %%CURL%%bin/elf2dmp
+bin/qemu-arm
 bin/qemu-edid
-bin/qemu-ga
 bin/qemu-i386
 bin/qemu-img
 bin/qemu-io
@@ -43,8 +43,6 @@ include/qemu-plugin.h
 %%PORTDOCS%%man/man1/qemu-img.1.gz
 %%PORTDOCS%%man/man7/qemu-block-drivers.7.gz
 %%PORTDOCS%%man/man7/qemu-cpu-models.7.gz
-%%PORTDOCS%%man/man8/qemu-ga.8.gz
-%%PORTDOCS%%man/man7/qemu-ga-ref.7.gz
 %%PORTDOCS%%man/man8/qemu-nbd.8.gz
 %%PORTDOCS%%man/man8/qemu-pr-helper.8.gz
 %%PORTDOCS%%man/man7/qemu-qmp-ref.7.gz
@@ -125,9 +123,7 @@ include/qemu-plugin.h
 %%DATADIR%%/openbios-sparc32
 %%DATADIR%%/openbios-sparc64
 %%DATADIR%%/opensbi-riscv32-generic-fw_dynamic.bin
-%%DATADIR%%/opensbi-riscv32-generic-fw_dynamic.elf
 %%DATADIR%%/opensbi-riscv64-generic-fw_dynamic.bin
-%%DATADIR%%/opensbi-riscv64-generic-fw_dynamic.elf
 %%DATADIR%%/palcode-clipper
 %%DATADIR%%/petalogix-ml605.dtb
 %%DATADIR%%/pxe-e1000.rom
@@ -160,6 +156,8 @@ include/qemu-plugin.h
 %%DATADIR%%/pvh.bin
 %%DATADIR%%/vgabios-bochs-display.bin
 %%DATADIR%%/vgabios-ramfb.bin
+%%DATADIR%%/vof-nvram.bin
+%%DATADIR%%/vof.bin
 share/icons/hicolor/128x128/apps/qemu.png
 share/icons/hicolor/16x16/apps/qemu.png
 share/icons/hicolor/24x24/apps/qemu.png