Skip to content

Commit

Permalink
scripts/qemu: enable libpmem
Browse files Browse the repository at this point in the history
Enable libpmem to support PMEM when running under Kubernetes.

see kata-containers/runtime#2262

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.

fixes kata-containers#958

Signed-off-by: Julio Montes <julio.montes@intel.com>
  • Loading branch information
Julio Montes committed Mar 2, 2020
1 parent 9a37ebe commit c0d45d8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions obs-packaging/qemu-vanilla/debian.rules-template
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export LANG=C

override_dh_auto_configure:
chmod a+x "../SOURCES/configure-hypervisor.sh"
eval "../SOURCES/configure-hypervisor.sh" "qemu-vanilla" | xargs ./configure --prefix=/usr
eval "../SOURCES/configure-hypervisor.sh" "qemu-vanilla" | sed -e 's/--enable-libpmem//g' | xargs ./configure --prefix=/usr
override_dh_auto_build:
make

Expand All @@ -24,4 +24,3 @@ override_dh_auto_test:

override_dh_auto_clean:
echo "Skip auto clean"

1 change: 1 addition & 0 deletions obs-packaging/qemu-vanilla/qemu-vanilla.spec-template
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ BuildRequires : python
BuildRequires : python-devel
BuildRequires : zlib-devel
BuildRequires : pkgconfig(pixman-1)
BuildRequires : libpmem-devel

# Patches
@RPM_PATCH_LIST@
Expand Down
9 changes: 5 additions & 4 deletions scripts/configure-hypervisor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,6 @@ generate_qemu_options() {
qemu_options+=(size:--disable-linux-aio)

if [[ "${qemu_version_major}" -ge 4 || ( "${qemu_version_major}" -eq 3 && "${qemu_version_minor}" -ge 1 ) ]]; then
# Disable libpmem, vNVDIMM backend (aka rootfs image) shouldn't be modifed
# by the guest
qemu_options+=(security:--disable-libpmem)

# Disable graphics
qemu_options+=(size:--disable-virglrenderer)

Expand Down Expand Up @@ -396,6 +392,11 @@ generate_qemu_options() {
fi
# Enable libc malloc_trim() for memory optimization.
qemu_options+=(speed:--enable-malloc-trim)

# 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)
fi

#---------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ parts:
- curl
- libcapstone-dev
- bc
- libpmem-dev
override-build: |
kata_version=$(cat ${SNAPCRAFT_STAGE}/kata_version)
yq=$(realpath ../../yq/build/yq)
Expand Down
1 change: 1 addition & 0 deletions static-build/qemu-virtiofs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RUN apt-get install -y \
libglib2.0-dev git \
libltdl-dev \
libpixman-1-dev \
libpmem-dev \
libseccomp-dev \
libtool \
patch \
Expand Down
1 change: 1 addition & 0 deletions static-build/qemu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RUN apt-get install -y \
libglib2.0-dev git \
libltdl-dev \
libpixman-1-dev \
libpmem-dev \
libtool \
pkg-config \
pkg-config \
Expand Down

0 comments on commit c0d45d8

Please sign in to comment.