From 83a69de4a24d50338b8f9a0962a21224612bf4ce Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Tue, 3 Mar 2020 17:59:31 +0000 Subject: [PATCH] scripts: enable libpmem only for x86_64 Not all architectures have support for libpmem. Enable libpmem only for x86_64 fixes #965 Signed-off-by: Julio Montes --- scripts/configure-hypervisor.sh | 10 +++++----- snap/snapcraft.yaml | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/configure-hypervisor.sh b/scripts/configure-hypervisor.sh index 535e051bc7..a5bac6fbe0 100755 --- a/scripts/configure-hypervisor.sh +++ b/scripts/configure-hypervisor.sh @@ -387,16 +387,16 @@ generate_qemu_options() { # for that architecture if [ "$arch" == x86_64 ]; then qemu_options+=(speed:--enable-avx2) + # 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) else qemu_options+=(speed:--disable-avx2) + qemu_options+=(functionality:--disable-libpmem) 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 #--------------------------------------------------------------------- diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index e89a9d323f..e8bcd59a96 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -338,7 +338,6 @@ parts: - curl - libcapstone-dev - bc - - libpmem-dev override-build: | kata_version=$(cat ${SNAPCRAFT_STAGE}/kata_version) yq=$(realpath ../../yq/build/yq) @@ -382,6 +381,9 @@ parts: --input "$patch" done + # Only x86_64 supports libpmem + [ "$(uname -m)" = "x86_64" ] && sudo apt-get install -y libpmem-dev + chmod +x ${SNAPCRAFT_STAGE}/scripts/configure-hypervisor.sh # static build echo "$(${SNAPCRAFT_STAGE}/scripts/configure-hypervisor.sh -s qemu) \