Skip to content

Commit

Permalink
Adding user_current_vol-url patch for the Cinder Queens release
Browse files Browse the repository at this point in the history
  • Loading branch information
casusbelli committed May 22, 2019
1 parent 4c6b0b4 commit 3fea04b
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ Please see the different patches readme files for their respective installation

These patches provides an all in one patch file per project for easier installation. These patch files correct a list of issues/features, including single issue fix patches availabe in this repository.

## overlay_volume_patch (**beta**)

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.

## return_for_create_clone_patch

Small patch that enables volume backups via volume cloning with Quobyte volumes. This change is part of the upstream code for releases Pike and newer.
Expand All @@ -32,12 +39,9 @@ Small patch that enables volume backups via volume cloning with Quobyte volumes.
Backport of a [Nova bugfix](https://review.openstack.org/#/c/432344/) for a [bug](https://bugs.launchpad.net/nova/+bug/1530860) that caused mounts to be removed when the Nova service was stopped or restarted.
This patch is part of the upstream code fore releases Pike and newer.

## overlay_volume_patch (**beta**)

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.
## user_current_vol-url patch

## qemu-img_commit_patch
A simple Cinder patch for setups encountering qemu-img commit crashes during snapshot deletion with v3 Kernels.
Patches the Cinder Quobyte driver to always use the currently configured quobyte_volume_url.

## xattr-removal_patch

Expand Down
61 changes: 61 additions & 0 deletions use_current_vol-url/Queens/use_current_vol-url.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
diff --git a/cinder/volume/drivers/quobyte.py b/cinder/volume/drivers/quobyte.py
index ab89a1fd6..877b71156 100644
--- a/cinder/volume/drivers/quobyte.py
+++ b/cinder/volume/drivers/quobyte.py
@@ -32,7 +32,7 @@ from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers import remotefs as remotefs_drv

-VERSION = '1.1.7'
+VERSION = '1.1.7p'

LOG = logging.getLogger(__name__)

@@ -88,6 +88,7 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed):
1.1.5 - Enables extension of volumes with snapshots
1.1.6 - Optimizes volume creation
1.1.7 - Support fuse subtype based Quobyte mount validation
+ 1.1.7p - Patched out of tree

"""

@@ -111,6 +112,13 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed):
self._execute('fallocate', '-l', '%sG' % size,
path, run_as_root=self._execute_as_root)

+ def _strip_qb_protocol(self, url):
+ # Strip quobyte:// from the URL
+ protocol = self.driver_volume_type + "://"
+ if url.startswith(protocol):
+ return url[len(protocol):]
+ return url
+
def do_setup(self, context):
"""Any initialization the volume driver does while starting."""
super(QuobyteDriver, self).do_setup(context)
@@ -376,12 +384,7 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed):
"""
self.shares = {}

- url = self.configuration.quobyte_volume_url
-
- # Strip quobyte:// from the URL
- protocol = self.driver_volume_type + "://"
- if url.startswith(protocol):
- url = url[len(protocol):]
+ url = self._strip_qb_protocol(self.configuration.quobyte_volume_url)

self.shares[url] = None # None = No extra mount options.

@@ -393,7 +396,10 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed):
:param quobyte_volume: string
"""
mount_path = self._get_mount_point_for_share(quobyte_volume)
- self._mount_quobyte(quobyte_volume, mount_path, ensure=True)
+ # NOTE(kaisers): Always use the currently configured volume url
+ self._mount_quobyte(
+ self._strip_qb_protocol(self.configuration.quobyte_volume_url),
+ mount_path, ensure=True)

@utils.synchronized('quobyte_ensure', external=False)
def _ensure_shares_mounted(self):
74 changes: 74 additions & 0 deletions use_current_vol-url/Queens/use_current_vol-url_full_source.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
diff --git a/cinder/tests/unit/volume/drivers/test_quobyte.py b/cinder/tests/unit/volume/drivers/test_quobyte.py
index ecec8eb68..5475eea40 100644
--- a/cinder/tests/unit/volume/drivers/test_quobyte.py
+++ b/cinder/tests/unit/volume/drivers/test_quobyte.py
@@ -313,7 +313,7 @@ class QuobyteDriverTestCase(test.TestCase):
mock_get_mount_point.assert_called_once_with(
self.TEST_QUOBYTE_VOLUME)
mock_mount.assert_called_once_with(
- self.TEST_QUOBYTE_VOLUME,
+ self.TEST_QUOBYTE_VOLUME_WITHOUT_PROTOCOL,
mock_get_mount_point.return_value,
ensure=True)

diff --git a/cinder/volume/drivers/quobyte.py b/cinder/volume/drivers/quobyte.py
index ab89a1fd6..877b71156 100644
--- a/cinder/volume/drivers/quobyte.py
+++ b/cinder/volume/drivers/quobyte.py
@@ -32,7 +32,7 @@ from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers import remotefs as remotefs_drv

-VERSION = '1.1.7'
+VERSION = '1.1.7p'

LOG = logging.getLogger(__name__)

@@ -88,6 +88,7 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed):
1.1.5 - Enables extension of volumes with snapshots
1.1.6 - Optimizes volume creation
1.1.7 - Support fuse subtype based Quobyte mount validation
+ 1.1.7p - Patched out of tree

"""

@@ -111,6 +112,13 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed):
self._execute('fallocate', '-l', '%sG' % size,
path, run_as_root=self._execute_as_root)

+ def _strip_qb_protocol(self, url):
+ # Strip quobyte:// from the URL
+ protocol = self.driver_volume_type + "://"
+ if url.startswith(protocol):
+ return url[len(protocol):]
+ return url
+
def do_setup(self, context):
"""Any initialization the volume driver does while starting."""
super(QuobyteDriver, self).do_setup(context)
@@ -376,12 +384,7 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed):
"""
self.shares = {}

- url = self.configuration.quobyte_volume_url
-
- # Strip quobyte:// from the URL
- protocol = self.driver_volume_type + "://"
- if url.startswith(protocol):
- url = url[len(protocol):]
+ url = self._strip_qb_protocol(self.configuration.quobyte_volume_url)

self.shares[url] = None # None = No extra mount options.

@@ -393,7 +396,10 @@ class QuobyteDriver(remotefs_drv.RemoteFSSnapDriverDistributed):
:param quobyte_volume: string
"""
mount_path = self._get_mount_point_for_share(quobyte_volume)
- self._mount_quobyte(quobyte_volume, mount_path, ensure=True)
+ # NOTE(kaisers): Always use the currently configured volume url
+ self._mount_quobyte(
+ self._strip_qb_protocol(self.configuration.quobyte_volume_url),
+ mount_path, ensure=True)

@utils.synchronized('quobyte_ensure', external=False)
def _ensure_shares_mounted(self):
17 changes: 17 additions & 0 deletions use_current_vol-url/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

## use_current_vol-url patch

This patch fixes the Cinder bug [1828993](https://bugs.launchpad.net/cinder/+bug/1828993) with patch [659265](https://review.opendev.org/#/c/659265/), thus ensuring always the currently configured quobyte_volume_url
is used in the Cinder Quobyte driver.

This patch applies to stripped packaged installations as well as full source tree installations. Slightly different patch commands are used (see below).

### Usage

This patch can be applied by navigating to the Cinder project root directory. For stripped packaged installations please run:

patch -p2 < /path/to/patchfile

For full source tree installations please run:

patch -p1 < /path/to/patchfile

0 comments on commit 3fea04b

Please sign in to comment.