-
Notifications
You must be signed in to change notification settings - Fork 89
qemu-virtiofs: Update to qemu 5.0 + virtiofs + dax #1097
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| from ubuntu:18.04 | ||
| from ubuntu:20.04 | ||
|
|
||
| ARG QEMU_VIRTIOFS_REPO | ||
| # commit/tag/branch | ||
|
|
@@ -19,37 +19,57 @@ RUN apt-get --no-install-recommends install -y \ | |
| flex \ | ||
| gawk \ | ||
| libaudit-dev \ | ||
| libblkid-dev \ | ||
| libcap-dev \ | ||
| libcap-ng-dev \ | ||
| libdw-dev \ | ||
| libelf-dev \ | ||
| libffi-dev \ | ||
| libglib2.0-0 \ | ||
| libglib2.0-dev \ | ||
| libglib2.0-dev git \ | ||
| libltdl-dev \ | ||
| libmount-dev \ | ||
| libpixman-1-dev \ | ||
| libpmem-dev \ | ||
| libseccomp-dev \ | ||
| libseccomp2 \ | ||
| libselinux1-dev \ | ||
| libtool \ | ||
| patch \ | ||
| make \ | ||
| pkg-config \ | ||
| pkg-config \ | ||
| python \ | ||
| python-dev \ | ||
| rsync \ | ||
| seccomp \ | ||
| libseccomp2 \ | ||
| zlib1g-dev | ||
|
|
||
| RUN cd .. && git clone "${QEMU_VIRTIOFS_REPO}" qemu-virtiofs | ||
| RUN git checkout "${QEMU_VIRTIOFS_TAG}" | ||
| ADD qemu/patches/virtiofsd/0001-add-time-to-seccomp.patch /root/0001-add-time-to-seccomp.patch | ||
| ADD qemu/patches/virtiofsd/0002-libvhost-user-Fix-the-VHOST_USER_PROTOCOL_F_SLAVE_SE.patch /root/0002-libvhost-user-Fix-the-VHOST_USER_PROTOCOL_F_SLAVE_SE.patch | ||
| RUN patch -p1 < /root/0001-add-time-to-seccomp.patch | ||
| RUN patch -p1 < /root/0002-libvhost-user-Fix-the-VHOST_USER_PROTOCOL_F_SLAVE_SE.patch | ||
|
|
||
| ADD scripts/configure-hypervisor.sh /root/configure-hypervisor.sh | ||
| RUN PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s kata-qemu | sed -e 's|--enable-rbd||g' -e 's|--disable-seccomp||g' | xargs ./configure \ | ||
| ADD qemu/patches/ /root/kata_qemu_patches | ||
|
|
||
| # Apply experimental specific patches | ||
| # Patches to quick fix virtiofs fork | ||
| ENV VIRTIOFS_PATCHES_DIR=/root/kata_qemu_patches/${QEMU_VIRTIOFS_TAG}/ | ||
| RUN find "${VIRTIOFS_PATCHES_DIR}" -name '*.patch' -type f |sort -t- -k1,1n > patches_virtiofs | ||
| RUN echo "Patches to apply for virtiofs fixes:" | ||
| RUN cat patches_virtiofs | ||
| RUN [ ! -s patches_virtiofs ] || git apply $(cat patches_virtiofs) | ||
|
|
||
| RUN cat VERSION | awk 'BEGIN{FS=OFS="."}{print $1 "." $2 ".x"}' > stable_branch | ||
| RUN echo "root/kata_qemu_patches/$(cat stable_branch)/" > patches_qemu_dir | ||
| RUN echo "patches dir $(cat patches_qemu_dir)" | ||
| RUN find "$(cat patches_qemu_dir)" -name '*.patch' -type f |sort -t- -k1,1n > patches_qemu | ||
| RUN echo "Patches to apply for qemu:" | ||
| RUN cat patches_qemu | ||
| RUN [ ! -s patches_qemu ] || git apply $(cat patches_qemu ) | ||
|
|
||
| RUN PREFIX="${PREFIX}" /root/configure-hypervisor.sh -s kata-qemu | sed -e 's|--disable-seccomp||g' | xargs ./configure \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should just drop this flag from configure-hypervisor itself. It makes sense to have seccomp at this point.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks I think that should be fixed in a separete PR for all places we use it. |
||
| --with-pkgversion=kata-static | ||
|
|
||
| RUN make -j$(nproc) | ||
| RUN make -j$(nproc) virtiofsd | ||
| RUN make install DESTDIR=/tmp/qemu-virtiofs-static | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,11 +13,17 @@ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| source "${script_dir}/../../scripts/lib.sh" | ||
| source "${script_dir}/../qemu.blacklist" | ||
|
|
||
| DOCKER_CLI="docker" | ||
|
|
||
| if ! command -v docker &>/dev/null && command -v podman &>/dev/null; then | ||
| DOCKER_CLI="podman" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why podman..for Fedora?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes :) |
||
| fi | ||
|
|
||
| kata_version="${kata_version:-}" | ||
| packaging_dir="${script_dir}/../.." | ||
| qemu_virtiofs_repo=$(get_from_kata_deps "assets.hypervisor.qemu-experimental.url" "${kata_version}") | ||
| # This tag will be supported on the runtime versions.yaml | ||
| qemu_virtiofs_tag=$(get_from_kata_deps "assets.hypervisor.qemu-experimental.tag" "${kata_version}") | ||
| qemu_virtiofs_tag=$(get_from_kata_deps "assets.hypervisor.qemu-experimental.tag" "${kata_version}") | ||
| qemu_virtiofs_tar="kata-static-qemu-virtiofsd.tar.gz" | ||
| qemu_tmp_tar="kata-static-qemu-virtiofsd-tmp.tar.gz" | ||
|
|
||
|
|
@@ -27,7 +33,7 @@ http_proxy="${http_proxy:-}" | |
| https_proxy="${https_proxy:-}" | ||
| prefix="${prefix:-"/opt/kata"}" | ||
|
|
||
| sudo docker build \ | ||
| sudo "${DOCKER_CLI}" build \ | ||
| --no-cache \ | ||
| --build-arg http_proxy="${http_proxy}" \ | ||
| --build-arg https_proxy="${https_proxy}" \ | ||
|
|
@@ -39,7 +45,7 @@ sudo docker build \ | |
| -f "${script_dir}/Dockerfile" \ | ||
| -t qemu-virtiofs-static | ||
|
|
||
| sudo docker run \ | ||
| sudo "${DOCKER_CLI}" run \ | ||
| -i \ | ||
| -v "${PWD}":/share qemu-virtiofs-static \ | ||
| mv "/tmp/qemu-virtiofs-static/${qemu_virtiofs_tar}" /share/ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: You might want to add
&>/dev/nullto both thecommandcalls (here and below) to avoid the paths appearing in build logs?