From 742c9d9f1093a37b9d651992251821c1fa3eb7f7 Mon Sep 17 00:00:00 2001 From: Jacob Wang Date: Sun, 1 Aug 2021 13:37:55 +0800 Subject: [PATCH] Adjust to support virtiofsd minor > 27 Signed-off-by: Jacob Wang --- ...iofsd-Adjust-limit-for-minor-version.patch | 41 +++++++++++++++++++ qemu-kvm.spec | 8 +++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 kvm-virtiofsd-Adjust-limit-for-minor-version.patch diff --git a/kvm-virtiofsd-Adjust-limit-for-minor-version.patch b/kvm-virtiofsd-Adjust-limit-for-minor-version.patch new file mode 100644 index 0000000..30ec553 --- /dev/null +++ b/kvm-virtiofsd-Adjust-limit-for-minor-version.patch @@ -0,0 +1,41 @@ +From 3b7200134925fcf5ae99b5c3b34465456d3bc002 Mon Sep 17 00:00:00 2001 +From: Jacob Wang +Date: Mon, 2 Aug 2021 01:16:05 +0800 +Subject: [PATCH 1/1] virtiofsd: Adjust limit for minor version + +Upstream virtiofsd only supports fuse >= 7.31 +(https://github.com/qemu/qemu/commit/72c42e2d65510e073cf78fdc924d121c77fa0080), +while Cloud Kernel has fuse version 7.27, which causes virtiofs fails to run +due to version mismatch. This limitation is unnecessary in Cloud Kernel because +we have already backported mandatory fuse patches to support virtofs +frontend in Kernel. Hence, adjust the minor version limit to 7.27 to +suppress the limitation. + +Note that current fuse implementation in Cloud Kernel might lack of some +certain capabilities in fuse 7.28 ~ 7.31, which may cause unexpected results, +this patch is merely a workaround to enable virtiofs in guest kernel side and +further action is ongoing to make sure fuse APIs in both sides are 100% +compatible. + +Signed-off-by: Jacob Wang +Acked-by: Caspar Zhang +--- + tools/virtiofsd/fuse_lowlevel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c +index 2dd36ec..2bb4318 100644 +--- a/tools/virtiofsd/fuse_lowlevel.c ++++ b/tools/virtiofsd/fuse_lowlevel.c +@@ -1917,7 +1917,7 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, + outarg.major = FUSE_KERNEL_VERSION; + outarg.minor = FUSE_KERNEL_MINOR_VERSION; + +- if (arg->major < 7 || (arg->major == 7 && arg->minor < 31)) { ++ if (arg->major < 7 || (arg->major == 7 && arg->minor < 27)) { + fuse_log(FUSE_LOG_ERR, "fuse: unsupported protocol version: %u.%u\n", + arg->major, arg->minor); + fuse_reply_err(req, EPROTO); +-- +1.8.3.1 + diff --git a/qemu-kvm.spec b/qemu-kvm.spec index f2f5fb5..35b3370 100644 --- a/qemu-kvm.spec +++ b/qemu-kvm.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 %global SLOF_gittagdate 20191022 %global SLOF_gittagcommit 899d9883 @@ -67,7 +68,7 @@ Obsoletes: %1-rhev <= %{epoch}:%{version}-%{release} Summary: QEMU is a machine emulator and virtualizer Name: qemu-kvm Version: 4.2.0 -Release: 59%{?dist} +Release: 59%{anolis_release}%{?dist} # Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped Epoch: 15 License: GPLv2 and GPLv2+ and CC-BY @@ -1249,6 +1250,8 @@ Patch543: kvm-virtiofsd-Fix-the-help-message-of-posix-lock.patch # For bz#1994041 - qemu-kvm scsi: change default passthrough timeout to non-infinite Patch544: kvm-scsi-make-io_timeout-configurable.patch +Patch1000: kvm-virtiofsd-Adjust-limit-for-minor-version.patch + BuildRequires: wget BuildRequires: rpm-build BuildRequires: zlib-devel @@ -2196,6 +2199,9 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %changelog +* Thu Dec 23 2021 Jacob Wang - 4.2.0-59.0.1 +- Adjust limit for virtiofsd minor version + * Fri Oct 01 2021 Jon Maloy - 4.2.0-59 - kvm-scsi-make-io_timeout-configurable.patch [bz#1994041] - Resolves: bz#1994041 -- Gitee