From 4c6b0b49fe8ca87b2687655a4cb1adc637ee1519 Mon Sep 17 00:00:00 2001 From: Silvan Kaiser Date: Fri, 30 Nov 2018 15:55:33 +0100 Subject: [PATCH] Adds qemu-img commit patch for Cinder with v3 Kernels --- README.md | 3 +++ qemu-img_commit_patch/README.md | 12 ++++++++++++ .../qemu-img_commit_patch_Ocata.patch | 13 +++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 qemu-img_commit_patch/README.md create mode 100644 qemu-img_commit_patch/qemu-img_commit_patch_Ocata.patch diff --git a/README.md b/README.md index ccce91e..ef63397 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,9 @@ This patch is part of the upstream code fore releases Pike and newer. Backport of the upstream changes for [overlay volumes](https://review.openstack.org/#/c/507050), the [volume_from_snapshot_cache](https://review.openstack.org/#/c/502974/9) and some [general volume creation optimizations](https://review.openstack.org/#/c/500782/) for Cinder. +## qemu-img_commit_patch +A simple Cinder patch for setups encountering qemu-img commit crashes during snapshot deletion with v3 Kernels. + ## xattr-removal_patch Backports of performance optimizations that remove the usage of xattr from the Nova driver and mount Quobyte volumes without xattr support, in order to improve iops. diff --git a/qemu-img_commit_patch/README.md b/qemu-img_commit_patch/README.md new file mode 100644 index 0000000..4c2a3e7 --- /dev/null +++ b/qemu-img_commit_patch/README.md @@ -0,0 +1,12 @@ + +## qemu-img_commit_patch for old v3 kernels + +Backports a very simple patch for Cinder setups that use qemu-img version 2.10+ with v3.10 Kernels. In case a setup hits issues with qemu-img crashing in a qemu-img commit call during snapshot deletion this patch provides a simple fix. +The patch has been added upstream with [change #6200926](https://review.openstack.org/#/c/620926/) and will be ported back to the previous three releases. Older releases are provided with this patch via this repository. + + +### Installation + +This patch can be applied by navigating to the Cinder project source root directory and running: + + patch -p1 < /path/to/patchfile diff --git a/qemu-img_commit_patch/qemu-img_commit_patch_Ocata.patch b/qemu-img_commit_patch/qemu-img_commit_patch_Ocata.patch new file mode 100644 index 0000000..4a05f5f --- /dev/null +++ b/qemu-img_commit_patch/qemu-img_commit_patch_Ocata.patch @@ -0,0 +1,13 @@ +diff --git a/cinder/volume/drivers/remotefs.py b/cinder/volume/drivers/remotefs.py +index 6f07cb90c..54f15f2ca 100644 +--- a/cinder/volume/drivers/remotefs.py ++++ b/cinder/volume/drivers/remotefs.py +@@ -744,7 +744,7 @@ class RemoteFSSnapDriverBase(RemoteFSDriver): + # NFS snapshots + # It needs to run as root for volumes attached to instances, but + # does not when in secure mode. +- self._execute('qemu-img', 'commit', path, ++ self._execute('qemu-img', 'commit', '-d', path, + run_as_root=self._execute_as_root) + self._delete(path) +