qemu: update to 6.1.0, add usb passthrough option

One of big change is that QEMU has switched to Meson build system.
That result in few changes to build scripts to fix python interpreter
usage.
Second change that it's not possible to select binaries to build, so
now we have to build all targets at once (that require --enable-tools).

Options --disable-sheepdog and --disable-vxhs was removed from qemu
6.1.0 and 6.0.0 accordingly.

Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
This commit is contained in:
Vladimir Ermakov 2021-07-02 22:36:04 +03:00 committed by Yousong Zhou
parent 58ce2b992f
commit b8ef617993
7 changed files with 39 additions and 44 deletions

View file

@ -9,12 +9,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=qemu PKG_NAME:=qemu
PKG_VERSION:=5.0.0 PKG_VERSION:=6.1.0
PKG_RELEASE:=5 PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=2f13a92a0fa5c8b69ff0796b59b86b080bbb92ebad5d301a7724dd06b5e78cb6 PKG_HASH:=eebc089db3414bbeedf1e464beda0a7515aad30f73261abc246c9b27503a3c96
PKG_SOURCE_URL:=http://download.qemu.org/ PKG_SOURCE_URL:=http://download.qemu.org/
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE tcg/LICENSE PKG_LICENSE_FILES:=LICENSE tcg/LICENSE
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com> PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
PKG_CPE_ID:=cpe:/a:qemu:qemu PKG_CPE_ID:=cpe:/a:qemu:qemu
@ -23,7 +23,7 @@ PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1 PKG_INSTALL:=1
PKG_USE_MIPS16:=0 PKG_USE_MIPS16:=0
PKG_BUILD_DEPENDS+=spice-protocol PKG_BUILD_DEPENDS+=spice-protocol meson/host
include $(INCLUDE_DIR)/nls.mk include $(INCLUDE_DIR)/nls.mk
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -96,7 +96,7 @@ endef
define Package/qemu-img/install define Package/qemu-img/install
$(INSTALL_DIR) $(1)/usr/bin/ $(INSTALL_DIR) $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/qemu-img $(1)/usr/bin/qemu-img $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/qemu-img $(1)/usr/bin/qemu-img
endef endef
@ -111,7 +111,7 @@ endef
define Package/qemu-nbd/install define Package/qemu-nbd/install
$(INSTALL_DIR) $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/qemu-nbd $(1)/usr/sbin/qemu-nbd $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/qemu-nbd $(1)/usr/sbin/qemu-nbd
endef endef
@ -190,12 +190,13 @@ define qemu-target
SUBMENU:=Virtualization SUBMENU:=Virtualization
TITLE:=QEMU target $(1) TITLE:=QEMU target $(1)
URL:=http://www.qemu.org URL:=http://www.qemu.org
DEPENDS:= +glib2 +libpthread +zlib $(QEMU_DEPS_IN_HOST) $(qemu-target-$(1)-deps) \ DEPENDS:= +glib2 +libpthread +zlib +libbpf $(QEMU_DEPS_IN_HOST) $(qemu-target-$(1)-deps) \
+QEMU_UI_VNC:qemu-keymaps \ +QEMU_UI_VNC:qemu-keymaps \
+QEMU_UI_VNC_JPEG:libjpeg \ +QEMU_UI_VNC_JPEG:libjpeg \
+QEMU_UI_VNC_PNG:libpng \ +QEMU_UI_VNC_PNG:libpng \
+QEMU_UI_VNC_SASL:libsasl2 \ +QEMU_UI_VNC_SASL:libsasl2 \
+QEMU_UI_SPICE:libspice-server \ +QEMU_UI_SPICE:libspice-server \
+QEMU_DEV_USB:libusb-1.0 \
$(if $(filter %-softmmu,$(1)),+libncurses +libfdt +pixman +qemu-firmware-efi $(ICONV_DEPENDS)) $(if $(filter %-softmmu,$(1)),+libncurses +libfdt +pixman +qemu-firmware-efi $(ICONV_DEPENDS))
endef endef
@ -257,6 +258,9 @@ config QEMU_UI_VNC_SASL
config QEMU_UI_SPICE config QEMU_UI_SPICE
bool "QEMU SPICE ui support" bool "QEMU SPICE ui support"
config QEMU_DEV_USB
bool "QEMU USB passthrough support"
endif endif
endef endef
@ -266,6 +270,7 @@ PKG_CONFIG_DEPENDS += \
CONFIG_QEMU_UI_VNC_PNG \ CONFIG_QEMU_UI_VNC_PNG \
CONFIG_QEMU_UI_VNC_SASL \ CONFIG_QEMU_UI_VNC_SASL \
CONFIG_QEMU_UI_SPICE \ CONFIG_QEMU_UI_SPICE \
CONFIG_QEMU_DEV_USB \
# QEMU configure script does not recognize these options # QEMU configure script does not recognize these options
@ -299,7 +304,9 @@ CONFIGURE_ARGS += \
--enable-vhost-scsi \ --enable-vhost-scsi \
--enable-vhost-user \ --enable-vhost-user \
--enable-vhost-user-fs \ --enable-vhost-user-fs \
--enable-vhost-user-blk-server \
--enable-vhost-vsock \ --enable-vhost-vsock \
--enable-vhost-vdpa \
# Image formats support # Image formats support
CONFIGURE_ARGS += \ CONFIGURE_ARGS += \
@ -351,6 +358,8 @@ CONFIGURE_ARGS += \
--enable-live-block-migration \ --enable-live-block-migration \
--enable-membarrier \ --enable-membarrier \
--enable-replication \ --enable-replication \
--enable-lto \
--enable-tools \
# Review configure options not explicitly specified here # Review configure options not explicitly specified here
# #
@ -375,7 +384,7 @@ CONFIGURE_ARGS += \
--disable-debug-tcg \ --disable-debug-tcg \
--disable-docs \ --disable-docs \
--disable-gcrypt \ --disable-gcrypt \
--disable-git-update \ --with-git-submodules=ignore \
--disable-glusterfs \ --disable-glusterfs \
--disable-gnutls \ --disable-gnutls \
--disable-guest-agent-msi \ --disable-guest-agent-msi \
@ -385,7 +394,7 @@ CONFIGURE_ARGS += \
--disable-libpmem \ --disable-libpmem \
--disable-libssh \ --disable-libssh \
--disable-libudev \ --disable-libudev \
--disable-libusb \ --$(if $(CONFIG_QEMU_DEV_USB),enable,disable)-libusb \
--disable-libxml2 \ --disable-libxml2 \
--disable-linux-aio \ --disable-linux-aio \
--disable-linux-io-uring \ --disable-linux-io-uring \
@ -405,19 +414,16 @@ CONFIGURE_ARGS += \
--disable-rdma \ --disable-rdma \
--disable-sanitizers \ --disable-sanitizers \
--disable-seccomp \ --disable-seccomp \
--disable-sheepdog \
--disable-smartcard \ --disable-smartcard \
--disable-snappy \ --disable-snappy \
--disable-sparse \ --disable-sparse \
--disable-strip \ --disable-strip \
--disable-tcg-interpreter \ --disable-tcg-interpreter \
--disable-tcmalloc \ --disable-tcmalloc \
--disable-tools \
--disable-tpm \ --disable-tpm \
--disable-usb-redir \ --disable-usb-redir \
--disable-vde \ --disable-vde \
--disable-virtfs \ --disable-virtfs \
--disable-vxhs \
--disable-werror \ --disable-werror \
--disable-xen-pci-passthrough \ --disable-xen-pci-passthrough \
--disable-xkbcommon \ --disable-xkbcommon \
@ -435,17 +441,6 @@ MAKE_FLAGS:=$(filter-out \
ARCH=% \ ARCH=% \
,$(MAKE_FLAGS)) ,$(MAKE_FLAGS))
QEMU_MAKE_TARGETS := \
$(if $(CONFIG_PACKAGE_qemu-ga),qemu-ga) \
$(if $(CONFIG_PACKAGE_qemu-bridge-helper),qemu-bridge-helper) \
$(if $(CONFIG_PACKAGE_qemu-img),qemu-img) \
$(if $(CONFIG_PACKAGE_qemu-nbd),qemu-nbd) \
$(foreach target,$(qemu-target-list),$(if $(CONFIG_PACKAGE_qemu-$(target)),$(target)/all)) \
define Build/Compile
$(if $(strip $(QEMU_MAKE_TARGETS)),$(call Build/Compile/Default,$(QEMU_MAKE_TARGETS)))
endef
$(eval $(call BuildPackage,virtio-console-helper)) $(eval $(call BuildPackage,virtio-console-helper))
$(eval $(call BuildPackage,qemu-ga)) $(eval $(call BuildPackage,qemu-ga))
$(eval $(call BuildPackage,qemu-bridge-helper)) $(eval $(call BuildPackage,qemu-bridge-helper))

View file

@ -11,9 +11,9 @@ OpenWrt base build system decide flavor of fortify_source to use
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -1601,6 +1601,8 @@ for opt do @@ -1581,6 +1581,8 @@ for opt do
;; ;;
--gdb=*) gdb_bin="$optarg" --disable-slirp-smbd) slirp_smbd=no
;; ;;
+ --disable-fortify-source) fortify_source="no" + --disable-fortify-source) fortify_source="no"
+ ;; + ;;

View file

@ -9,9 +9,9 @@ Subject: [PATCH] configure: allow enabling/disabling libudev from command line
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -1601,6 +1601,10 @@ for opt do @@ -1581,6 +1581,10 @@ for opt do
;; ;;
--gdb=*) gdb_bin="$optarg" --disable-slirp-smbd) slirp_smbd=no
;; ;;
+ --enable-libudev) libudev=yes + --enable-libudev) libudev=yes
+ ;; + ;;

View file

@ -14,7 +14,7 @@ Fixes a512590 ("configure: qemu-ga is only needed with softmmu targets")
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -6414,7 +6414,7 @@ fi @@ -4375,7 +4375,7 @@ fi
# Probe for guest agent support/options # Probe for guest agent support/options
if [ "$guest_agent" != "no" ]; then if [ "$guest_agent" != "no" ]; then
@ -22,4 +22,4 @@ Fixes a512590 ("configure: qemu-ga is only needed with softmmu targets")
+ if [ "$guest_agent" = "" -a "$want_tools" = no ] ; then + if [ "$guest_agent" = "" -a "$want_tools" = no ] ; then
guest_agent=no guest_agent=no
elif [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then elif [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" -o "$mingw32" = "yes" ] ; then
tools="qemu-ga\$(EXESUF) $tools" guest_agent=yes

View file

@ -9,21 +9,21 @@ Subject: [PATCH] pc-bios: fix compilation when $(AS) is actually gcc driver
--- a/pc-bios/optionrom/Makefile --- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile
@@ -34,7 +34,7 @@ endif @@ -36,7 +36,7 @@ override CFLAGS += -m32 -include $(SRC_D
QEMU_INCLUDES += -I$(SRC_PATH) endif
Wa = -Wa, Wa = -Wa,
-ASFLAGS += -32 -override ASFLAGS += -32
+ASFLAGS += $(Wa)-32 +override ASFLAGS += $(Wa)-32
QEMU_CFLAGS += $(call cc-c-option, $(QEMU_CFLAGS), $(Wa)-32) override CFLAGS += $(call cc-option, $(Wa)-32)
build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
@@ -44,7 +44,7 @@ build-all: multiboot.bin linuxboot.bin l
LD_I386_EMULATION ?= elf_i386
@@ -47,7 +47,7 @@ all: multiboot.bin linuxboot.bin linuxbo
pvh.img: pvh.o pvh_main.o
%.o: %.S %.o: %.S
- $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$(TARGET_DIR)$@") - $(call quiet-command,$(CPP) $(CPPFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$@")
+ $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@ -x assembler -,"AS","$(TARGET_DIR)$@") + $(call quiet-command,$(CPP) $(CPPFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@ -x assembler -,"AS","$@")
pvh.img: pvh.o pvh_main.o %.o: %.c
$(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_I386_EMULATION) -T $(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $^,"BUILD","$(TARGET_DIR)$@") $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@,"CC","$@")

View file

@ -32,7 +32,7 @@ Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
#endif /* CONFIG_LINUX */ #endif /* CONFIG_LINUX */
#include "qemu/osdep.h" #include "qemu/osdep.h"
@@ -27,6 +24,13 @@ @@ -29,6 +26,13 @@
#include <sys/vfs.h> #include <sys/vfs.h>
#endif #endif

View file

@ -38,7 +38,7 @@ https://gitlab.alpinelinux.org/alpine/aports/commit/76b81b486480fd9c3294cd420bcf
@@ -111,6 +115,7 @@ void qmp_guest_shutdown(bool has_mode, c @@ -111,6 +115,7 @@ void qmp_guest_shutdown(bool has_mode, c
execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0", execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
"hypervisor initiated shutdown", (char*)NULL, environ); "hypervisor initiated shutdown", (char *)NULL, environ);
+ execle(fallback_cmd, fallback_cmd, (char*)NULL, environ); + execle(fallback_cmd, fallback_cmd, (char*)NULL, environ);
_exit(EXIT_FAILURE); _exit(EXIT_FAILURE);
} else if (pid < 0) { } else if (pid < 0) {