From 98d01ce6b9261d93f9197bb6f1b40b1b17deaca7 Mon Sep 17 00:00:00 2001 From: Carlos Venegas Date: Fri, 19 Mar 2021 16:14:21 +0000 Subject: [PATCH] qemu: Apply patches for specific versions. Today we apply patches per base branch. Having two qemu versions in a similar base version can make can have problems if one of the trees already has a patch. If a patch is needed only for one specific tag/commit add only the patch to that version. Signed-off-by: Carlos Venegas --- .../tag_patches/qemu5.0-virtiofs-with51bits-dax/no_patches.txt | 0 ...-virtiofsd-Add-o-allow_direct_io-no_allow_direct_io-o.patch | 0 .../0005-virtiofsd-extract-lo_do_open-from-lo_open.patch | 0 ...-virtiofsd-optionally-return-inode-pointer-from-lo_do.patch | 0 ...-virtiofsd-prevent-opening-of-special-files-CVE-2020-.patch | 0 tools/packaging/qemu/patches/tag_patches/v5.2.0/no_patches.txt | 0 tools/packaging/static-build/qemu/Dockerfile | 3 +++ 7 files changed, 3 insertions(+) create mode 100644 tools/packaging/qemu/patches/tag_patches/qemu5.0-virtiofs-with51bits-dax/no_patches.txt rename tools/packaging/qemu/patches/{ => tag_patches}/v5.0.0/0004-virtiofsd-Add-o-allow_direct_io-no_allow_direct_io-o.patch (100%) rename tools/packaging/qemu/patches/{ => tag_patches}/v5.0.0/0005-virtiofsd-extract-lo_do_open-from-lo_open.patch (100%) rename tools/packaging/qemu/patches/{ => tag_patches}/v5.0.0/0006-virtiofsd-optionally-return-inode-pointer-from-lo_do.patch (100%) rename tools/packaging/qemu/patches/{ => tag_patches}/v5.0.0/0007-virtiofsd-prevent-opening-of-special-files-CVE-2020-.patch (100%) create mode 100644 tools/packaging/qemu/patches/tag_patches/v5.2.0/no_patches.txt diff --git a/tools/packaging/qemu/patches/tag_patches/qemu5.0-virtiofs-with51bits-dax/no_patches.txt b/tools/packaging/qemu/patches/tag_patches/qemu5.0-virtiofs-with51bits-dax/no_patches.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/packaging/qemu/patches/v5.0.0/0004-virtiofsd-Add-o-allow_direct_io-no_allow_direct_io-o.patch b/tools/packaging/qemu/patches/tag_patches/v5.0.0/0004-virtiofsd-Add-o-allow_direct_io-no_allow_direct_io-o.patch similarity index 100% rename from tools/packaging/qemu/patches/v5.0.0/0004-virtiofsd-Add-o-allow_direct_io-no_allow_direct_io-o.patch rename to tools/packaging/qemu/patches/tag_patches/v5.0.0/0004-virtiofsd-Add-o-allow_direct_io-no_allow_direct_io-o.patch diff --git a/tools/packaging/qemu/patches/v5.0.0/0005-virtiofsd-extract-lo_do_open-from-lo_open.patch b/tools/packaging/qemu/patches/tag_patches/v5.0.0/0005-virtiofsd-extract-lo_do_open-from-lo_open.patch similarity index 100% rename from tools/packaging/qemu/patches/v5.0.0/0005-virtiofsd-extract-lo_do_open-from-lo_open.patch rename to tools/packaging/qemu/patches/tag_patches/v5.0.0/0005-virtiofsd-extract-lo_do_open-from-lo_open.patch diff --git a/tools/packaging/qemu/patches/v5.0.0/0006-virtiofsd-optionally-return-inode-pointer-from-lo_do.patch b/tools/packaging/qemu/patches/tag_patches/v5.0.0/0006-virtiofsd-optionally-return-inode-pointer-from-lo_do.patch similarity index 100% rename from tools/packaging/qemu/patches/v5.0.0/0006-virtiofsd-optionally-return-inode-pointer-from-lo_do.patch rename to tools/packaging/qemu/patches/tag_patches/v5.0.0/0006-virtiofsd-optionally-return-inode-pointer-from-lo_do.patch diff --git a/tools/packaging/qemu/patches/v5.0.0/0007-virtiofsd-prevent-opening-of-special-files-CVE-2020-.patch b/tools/packaging/qemu/patches/tag_patches/v5.0.0/0007-virtiofsd-prevent-opening-of-special-files-CVE-2020-.patch similarity index 100% rename from tools/packaging/qemu/patches/v5.0.0/0007-virtiofsd-prevent-opening-of-special-files-CVE-2020-.patch rename to tools/packaging/qemu/patches/tag_patches/v5.0.0/0007-virtiofsd-prevent-opening-of-special-files-CVE-2020-.patch diff --git a/tools/packaging/qemu/patches/tag_patches/v5.2.0/no_patches.txt b/tools/packaging/qemu/patches/tag_patches/v5.2.0/no_patches.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/packaging/static-build/qemu/Dockerfile b/tools/packaging/static-build/qemu/Dockerfile index 3d6787531f..7fa2915901 100644 --- a/tools/packaging/static-build/qemu/Dockerfile +++ b/tools/packaging/static-build/qemu/Dockerfile @@ -59,9 +59,12 @@ ADD qemu /root/kata_qemu ADD scripts/apply_patches.sh /root/apply_patches.sh ADD static-build /root/static-build +RUN echo "Apply patches for base version" RUN stable_branch=$(cat VERSION | awk 'BEGIN{FS=OFS="."}{print $1 "." $2 ".x"}') && \ /root/apply_patches.sh "/root/kata_qemu/patches/${stable_branch}" +RUN echo "Apply patches for specific qemu version" +RUN /root/apply_patches.sh "/root/kata_qemu/patches/tag_patches/${QEMU_VERSION}" RUN PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s kata-qemu | xargs ./configure \ --with-pkgversion=kata-static