Reshuffle the patches, drop copy-volume-to-image and vice versa
The patches will be submitted upstream in a slightly different manner,
so reflect that in the CI runs.
Change-Id: I114cbb2fb8f15beb908f6ce574ef50d12f43d3d7
diff --git a/patches/openstack/cinder/sep-sp-rm-copy-volimg.patch b/patches/openstack/cinder/sep-sp-rm-copy-volimg.patch
new file mode 100644
index 0000000..da8be40
--- /dev/null
+++ b/patches/openstack/cinder/sep-sp-rm-copy-volimg.patch
@@ -0,0 +1,71 @@
+From d93a652c373a95e8ebcadd6ee002f725deebbdbd Mon Sep 17 00:00:00 2001
+From: Peter Penchev <openstack-dev@storpool.com>
+Date: Mon, 26 Sep 2022 16:04:36 +0300
+Subject: [PATCH 6/7] StorPool: drop copy_image_to_volume() and
+ copy_volume_to_image()
+
+These methods seem to be leftovers from a bygone era when the parent
+driver could not or would not attach volumes safely.
+
+Change-Id: I6e1a9026e677aee6c7ccad908fe6f92dc253762a
+---
+ cinder/volume/drivers/storpool.py | 43 -------------------------------
+ 1 file changed, 43 deletions(-)
+
+diff --git a/cinder/volume/drivers/storpool.py b/cinder/volume/drivers/storpool.py
+index cccda8ecb..cdaf0043d 100644
+--- a/cinder/volume/drivers/storpool.py
++++ b/cinder/volume/drivers/storpool.py
+@@ -315,49 +315,6 @@ class StorPoolDriver(driver.VolumeDriver):
+ 'pools': pools
+ }
+
+- def copy_volume_to_image(self, context, volume, image_service, image_meta):
+- req_id = context.request_id
+- volname = self._attach.volumeName(volume['id'])
+- name = self._attach.volsnapName(volume['id'], req_id)
+- try:
+- self._attach.api().snapshotCreate(volname, {'name': name})
+- except spapi.ApiError as e:
+- raise self._backendException(e)
+- self._attach.add(req_id, {
+- 'volume': name,
+- 'type': 'copy-from',
+- 'id': req_id,
+- 'rights': 1,
+- 'volsnap': True
+- })
+- try:
+- return super(StorPoolDriver, self).copy_volume_to_image(
+- context, volume, image_service, image_meta)
+- finally:
+- self._attach.remove(req_id)
+- try:
+- self._attach.api().snapshotDelete(name)
+- except spapi.ApiError as e:
+- LOG.error(
+- 'Could not remove the temp snapshot %(name)s for '
+- '%(vol)s: %(err)s',
+- {'name': name, 'vol': volname, 'err': e})
+-
+- def copy_image_to_volume(self, context, volume, image_service, image_id):
+- req_id = context.request_id
+- name = self._attach.volumeName(volume['id'])
+- self._attach.add(req_id, {
+- 'volume': name,
+- 'type': 'copy-to',
+- 'id': req_id,
+- 'rights': 2
+- })
+- try:
+- return super(StorPoolDriver, self).copy_image_to_volume(
+- context, volume, image_service, image_id)
+- finally:
+- self._attach.remove(req_id)
+-
+ def extend_volume(self, volume, new_size):
+ size = int(new_size) * units.Gi
+ name = self._attach.volumeName(volume['id'])
+--
+2.35.1
+