Skip to content

Commit

Permalink
Merge pull request kata-containers#10492 from zvonkok/upgrade-qemu-9.1.0
Browse files Browse the repository at this point in the history
qemu: Upgrade qemu 9.1.2
  • Loading branch information
fidencio authored Dec 12, 2024
2 parents 07fe732 + cc9eced commit 7b0c1d0
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 32 deletions.
Empty file.
Empty file.
32 changes: 23 additions & 9 deletions tools/packaging/scripts/configure-hypervisor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ generate_qemu_options() {

# Disabled options

# Disable block migration in the main migration stream
qemu_options+=(size:--disable-live-block-migration)

# braille support not required
qemu_options+=(size:--disable-brlapi)

Expand Down Expand Up @@ -397,6 +394,23 @@ generate_qemu_options() {
qemu_options+=(size:--disable-vhdx)
qemu_options+=(size:--disable-hv-balloon)

# Disable various features based on the qemu_version
if gt_eq "${qemu_version}" "9.1.0" ; then
# Disable Query Processing Library support
qemu_options+=(size:--disable-qpl)
# Disable UADK Library support
qemu_options+=(size:--disable-uadk)
# Disable syscall buffer debugging support
qemu_options+=(size:--disable-debug-remap)

fi

# Disable gio support
qemu_options+=(size:--disable-gio)
# Disable libdaxctl part of ndctl support
qemu_options+=(size:--disable-libdaxctl)
qemu_options+=(size:--disable-oss)

#---------------------------------------------------------------------
# Enabled options

Expand All @@ -409,6 +423,7 @@ generate_qemu_options() {

# Support Linux AIO (native)
qemu_options+=(size:--enable-linux-aio)
qemu_options+=(size:--enable-linux-io-uring)

# Support Ceph RADOS Block Device (RBD)
[ -z "${static}" ] && qemu_options+=(functionality:--enable-rbd)
Expand All @@ -427,15 +442,14 @@ generate_qemu_options() {
# for that architecture
if [ "$arch" == x86_64 ]; then
qemu_options+=(speed:--enable-avx2)
qemu_options+=(speed:--enable-avx512f)
# According to QEMU's nvdimm documentation: When 'pmem' is 'on' and QEMU is
# built with libpmem support, QEMU will take necessary operations to guarantee
# the persistence of its own writes to the vNVDIMM backend.
qemu_options+=(functionality:--enable-libpmem)
qemu_options+=(speed:--enable-avx512bw)
else
qemu_options+=(speed:--disable-avx2)
qemu_options+=(functionality:--disable-libpmem)
fi
# We're disabling pmem support, it is heavilly broken with
# Ubuntu's static build of QEMU
qemu_options+=(functionality:--disable-libpmem)

# Enable libc malloc_trim() for memory optimization.
qemu_options+=(speed:--enable-malloc-trim)

Expand Down
25 changes: 10 additions & 15 deletions tools/packaging/static-build/qemu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2020 Ant Group
#
# SPDX-License-Identifier: Apache-2.0
FROM ubuntu:20.04
FROM ubuntu:22.04

# CACHE_TIMEOUT: date to invalid cache, if the date changes the image will be rebuild
# This is required to keep build dependencies with security fixes.
Expand All @@ -17,13 +17,13 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN if [ "${ARCH}" != "$(uname -m)" ]; then sed -i 's/^deb/deb [arch=amd64]/g' /etc/apt/sources.list && \
dpkg --add-architecture "${DPKG_ARCH#:}" && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ focal main restricted" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ focal-updates main restricted" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ focal universe" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ focal-updates universe" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ focal multiverse" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ focal-updates multiverse" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list; fi
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy main restricted" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy-updates main restricted" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy universe" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy-updates universe" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy multiverse" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy-updates multiverse" >> /etc/apt/sources.list && \
echo "deb [arch=${DPKG_ARCH#:}] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" >> /etc/apt/sources.list; fi

RUN apt-get update && apt-get upgrade -y && \
apt-get --no-install-recommends install -y \
Expand Down Expand Up @@ -53,6 +53,7 @@ RUN apt-get update && apt-get upgrade -y && \
libpixman-1-dev${DPKG_ARCH} \
libselinux1-dev${DPKG_ARCH} \
libtool${DPKG_ARCH} \
liburing-dev${DPKG_ARCH} \
make \
ninja-build \
pkg-config${DPKG_ARCH} \
Expand All @@ -62,17 +63,11 @@ RUN apt-get update && apt-get upgrade -y && \
python3 \
python3-dev \
python3-venv \
python3-tomli \
rsync \
zlib1g-dev${DPKG_ARCH} && \
if [ "${ARCH}" != s390x ]; then apt-get install -y --no-install-recommends libpmem-dev${DPKG_ARCH}; fi && \
GCC_ARCH="${ARCH}" && if [ "${ARCH}" = "ppc64le" ]; then GCC_ARCH="powerpc64le"; fi && \
if [ "${ARCH}" != "$(uname -m)" ]; then apt-get install --no-install-recommends -y gcc-"${GCC_ARCH}"-linux-gnu; fi && \
apt-get clean && rm -rf /var/lib/apt/lists/

RUN git clone https://github.com/axboe/liburing/ ~/liburing && \
cd ~/liburing && \
git checkout tags/liburing-2.1 && \
GCC_ARCH="${ARCH}" && if [ "${ARCH}" = "ppc64le" ]; then GCC_ARCH="powerpc64le"; fi && \
if [ "${ARCH}" != "$(uname -m)" ]; then PREFIX="${GCC_ARCH}-linux-gnu"; fi && \
./configure --cc=${GCC_ARCH}-linux-gnu-gcc --cxx=${GCC_ARCH}-linux-gnu-cpp --prefix=/usr/${PREFIX}/ && \
make && make install && ldconfig
10 changes: 5 additions & 5 deletions tools/packaging/static-build/qemu/build-base-qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ ${container_engine} pull ${container_image} || ("${container_engine}" build \
# No-op unless PUSH_TO_REGISTRY is exported as "yes"
push_to_registry "${container_image}")

"${container_engine}" run \
--rm \
-i \
"${container_engine}" run --rm -i \
--env BUILD_SUFFIX="${build_suffix}" \
--env PKGVERSION="${PKGVERSION}" \
--env QEMU_DESTDIR="${qemu_destdir}" \
Expand All @@ -71,7 +69,9 @@ ${container_engine} pull ${container_image} || ("${container_engine}" build \
--env HYPERVISOR_NAME="${HYPERVISOR_NAME}" \
--env QEMU_VERSION_NUM="${qemu_version}" \
--env ARCH="${ARCH}" \
-v "${repo_root_dir}:/root/kata-containers" \
--user "$(id -u)":"$(id -g)" \
-w "${PWD}" \
-v "${repo_root_dir}:${repo_root_dir}" \
-v "${PWD}":/share "${container_image}" \
bash -c "/root/kata-containers/tools/packaging/static-build/qemu/build-qemu.sh"
bash -c "${qemu_builder}"

4 changes: 3 additions & 1 deletion tools/packaging/static-build/qemu/build-qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ set -o errexit
set -o nounset
set -o pipefail

kata_packaging_dir="/root/kata-containers/tools/packaging"
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

kata_packaging_dir="${script_dir}/../.."
kata_packaging_scripts="${kata_packaging_dir}/scripts"

kata_static_build_dir="${kata_packaging_dir}/static-build"
Expand Down
4 changes: 2 additions & 2 deletions versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ assets:
qemu:
description: "VMM that uses KVM"
url: "https://github.com/qemu/qemu"
version: "v8.2.4"
tag: "v8.2.4"
version: "v9.1.2"
tag: "v9.1.2"
# Do not include any non-full release versions
# Break the line *without CR or space being appended*, to appease
# yamllint, and note the deliberate ' ' at the end of the expression.
Expand Down

0 comments on commit 7b0c1d0

Please sign in to comment.