Re: block snapshot issue with RBD

2024-05-28 Thread Ilya Dryomov
On Mon, May 27, 2024 at 9:06 PM Jin Cao wrote: > > Supplementary info: VM is paused after "migrate" command. After being > resumed with "cont", snapshot_delete_blkdev_internal works again, which > is confusing, as disk snapshot generally recommend I/O is paused, and a > frozen VM satisfy this requ

Re: [PATCH 6/7] block: Clean up local variable shadowing

2023-09-11 Thread Ilya Dryomov
gt; else rename variables. For rbd > block/rbd.c | 2 +- Acked-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH v6 0/3] block/rbd: Add support for layered encryption

2023-02-22 Thread Ilya Dryomov
On Mon, Jan 30, 2023 at 2:16 PM Ilya Dryomov wrote: > > On Sun, Jan 29, 2023 at 12:31 PM o...@il.ibm.com > wrote: > > > > v6: nit fixes > > v5: nit fixes > > v4: split to multiple commits > > add support for more than just luks-any in layered encryptio

Re: [PATCH v6 0/3] block/rbd: Add support for layered encryption

2023-01-30 Thread Ilya Dryomov
-- > qapi/block-core.json | 31 ++- > 2 files changed, 205 insertions(+), 14 deletions(-) > > -- > 2.25.1 > Reviewed-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH v5 3/3] block/rbd: Add support for layered encryption

2023-01-27 Thread Ilya Dryomov
On Sun, Jan 15, 2023 at 1:40 PM Or Ozeri wrote: > > Starting from ceph Reef, RBD has built-in support for layered encryption, > where each ancestor image (in a cloned image setting) can be possibly > encrypted using a unique passphrase. > > A new function, rbd_encryption_load2, was added to librbd

Re: [PATCH v5 0/3] block/rbd: Add support for layered encryption

2023-01-27 Thread Ilya Dryomov
re.json | 31 ++- > 2 files changed, 206 insertions(+), 14 deletions(-) > > -- > 2.25.1 > > Hi Or, Looks good, just a couple of really minor nits which can be ignored if you don't end up reposting. Reviewed-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH v1 1/1] virtio-block: switch to blk_get_max_hw_transfer

2023-01-12 Thread Ilya Dryomov
On Thu, Dec 9, 2021 at 10:34 AM Or Ozeri wrote: > > The blk_get_max_hw_transfer API was recently added in 6.1.0. > It allows querying an underlying block device its max transfer capability. > This commit changes virtio-blk to use this. > > Signed-off-by: Or Ozeri > --- > hw/block/virtio-blk.c |

Re: [PATCH v4 1/3] block/rbd: encryption nit fixes

2023-01-12 Thread Ilya Dryomov
On Thu, Jan 12, 2023 at 3:46 PM Daniel P. Berrangé wrote: > > On Thu, Jan 12, 2023 at 03:26:56PM +0100, Ilya Dryomov wrote: > > On Thu, Jan 12, 2023 at 1:35 PM Daniel P. Berrangé > > wrote: > > > > > > On Sun, Nov 20, 2022 at 04:28:34AM -0600, Or Ozeri

Re: [PATCH v4 1/3] block/rbd: encryption nit fixes

2023-01-12 Thread Ilya Dryomov
On Thu, Jan 12, 2023 at 1:35 PM Daniel P. Berrangé wrote: > > On Sun, Nov 20, 2022 at 04:28:34AM -0600, Or Ozeri wrote: > > Add const modifier to passphrases, > > and remove redundant stack variable passphrase_len. > > > > Signed-off-by: Or Ozeri > > --- > > block/rbd.c | 24 ++--

Re: [PATCH v4 3/3] block/rbd: Add support for layered encryption

2023-01-12 Thread Ilya Dryomov
On Sun, Nov 20, 2022 at 11:28 AM Or Ozeri wrote: > > Starting from ceph Reef, RBD has built-in support for layered encryption, > where each ancestor image (in a cloned image setting) can be possibly > encrypted using a unique passphrase. > > A new function, rbd_encryption_load2, was added to librb

Re: [PATCH v3] block/rbd: Add support for layered encryption

2022-11-16 Thread Ilya Dryomov
On Wed, Nov 16, 2022 at 12:15 PM Daniel P. Berrangé wrote: > > On Wed, Nov 16, 2022 at 10:23:52AM +, Daniel P. Berrangé wrote: > > On Wed, Nov 16, 2022 at 09:03:31AM +, Or Ozeri wrote: > > > > -Original Message- > > > > From: Daniel P. Berrangé > > > > Sent: 15 November 2022 19:47

Re: [PATCH v3] block/rbd: Add support for layered encryption

2022-11-15 Thread Ilya Dryomov
On Tue, Nov 15, 2022 at 1:25 PM Or Ozeri wrote: > > Starting from ceph Reef, RBD has built-in support for layered encryption, > where each ancestor image (in a cloned image setting) can be possibly > encrypted using a unique passphrase. > > A new function, rbd_encryption_load2, was added to librbd

Re: [PATCH v2] block/rbd: Add support for layered encryption

2022-11-15 Thread Ilya Dryomov
On Sun, Nov 13, 2022 at 11:17 AM Or Ozeri wrote: > > Starting from ceph Reef, RBD has built-in support for layered encryption, > where each ancestor image (in a cloned image setting) can be possibly > encrypted using a unique passphrase. > > A new function, rbd_encryption_load2, was added to librb

Re: [PATCH v1] block/rbd: Add support for layered encryption

2022-11-15 Thread Ilya Dryomov
On Sun, Nov 13, 2022 at 11:16 AM Or Ozeri wrote: > > > > > -Original Message- > > From: Ilya Dryomov > > Sent: 11 November 2022 15:01 > > To: Or Ozeri > > Cc: qemu-devel@nongnu.org; qemu-bl...@nongnu.org; Danny Harnik > > > > Subjec

Re: [PATCH v1] block/rbd: Add support for layered encryption

2022-11-11 Thread Ilya Dryomov
On Wed, Oct 26, 2022 at 10:48 AM Or Ozeri wrote: > > Starting from ceph Reef, RBD has built-in support for layered encryption, > where each ancestor image (in a cloned image setting) can be possibly > encrypted using a unique passphrase. > > A new function, rbd_encryption_load2, was added to librb

Re: [PATCH] block/rbd: report a better error when namespace does not exist

2022-05-16 Thread Ilya Dryomov
goto failed_ioctx_destroy; > +} > +} > +#endif > + > /* > * Set the namespace after opening the io context on the pool, > * if nspace == NULL or if nspace == "", it is just as we did nothing > @@ -840,6 +860,10 @@ static int qemu_rbd_connect(rados_t *cluster, > rados_ioctx_t *io_ctx, > r = 0; > goto out; > > +#ifdef HAVE_RBD_NAMESPACE_EXISTS > +failed_ioctx_destroy: > +rados_ioctx_destroy(*io_ctx); > +#endif > failed_shutdown: > rados_shutdown(*cluster); > out: > -- > 2.35.3 > Reviewed-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH] block/rbd: fix write zeroes with growing images

2022-03-19 Thread Ilya Dryomov
On Sat, Mar 19, 2022 at 1:40 PM Ilya Dryomov wrote: > > On Fri, Mar 18, 2022 at 9:25 AM Stefano Garzarella > wrote: > > > > On Thu, Mar 17, 2022 at 07:27:05PM +0100, Peter Lieven wrote: > > > > > > > > >> Am 17.03.2022 um 17:26 schrieb St

Re: [PATCH] block/rbd: fix write zeroes with growing images

2022-03-19 Thread Ilya Dryomov
On Fri, Mar 18, 2022 at 9:25 AM Stefano Garzarella wrote: > > On Thu, Mar 17, 2022 at 07:27:05PM +0100, Peter Lieven wrote: > > > > > >> Am 17.03.2022 um 17:26 schrieb Stefano Garzarella : > >> > >> Commit d24f80234b ("block/rbd: increase dynamically the image size") > >> added a workaround to su

Re: [PATCH] block/rbd: fix write zeroes with growing images

2022-03-19 Thread Ilya Dryomov
rrent size. > - */ > -if (offset + bytes > s->image_size) { > - int r = qemu_rbd_resize(bs, offset + bytes); > -if (r < 0) { > -return r; > -} > -} > return qemu_rbd_start_co(bs, offset, bytes, qiov, flags, RBD_AIO_WRITE); > } > > -- > 2.35.1 > Reviewed-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH V2 for-6.2 0/2] fixes for bdrv_co_block_status

2022-01-14 Thread Ilya Dryomov
hese patches have both "for-6.2" in the subject and Cc: qemu-sta...@nongnu.org in the description, which is a little confusing. Just want to clarify that they should go into master and be backported to 6.2. Reviewed-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH V2 for-6.2 2/2] block/rbd: workaround for ceph issue #53784

2022-01-14 Thread Ilya Dryomov
On Thu, Jan 13, 2022 at 3:44 PM Peter Lieven wrote: > > librbd had a bug until early 2022 that affected all versions of ceph that > supported fast-diff. This bug results in reporting of incorrect offsets > if the offset parameter to rbd_diff_iterate2 is not object aligned. > > This patch works aro

Re: [PATCH 1/2] block/rbd: fix handling of holes in .bdrv_co_block_status

2022-01-12 Thread Ilya Dryomov
On Wed, Jan 12, 2022 at 9:39 PM Peter Lieven wrote: > > Am 12.01.22 um 10:05 schrieb Ilya Dryomov: > > On Mon, Jan 10, 2022 at 12:42 PM Peter Lieven wrote: > >> the assumption that we can't hit a hole if we do not diff against a > >> snapshot was wrong. >

Re: [PATCH 2/2] block/rbd: workaround for ceph issue #53784

2022-01-12 Thread Ilya Dryomov
On Wed, Jan 12, 2022 at 12:55 PM Peter Lieven wrote: > > Am 12.01.22 um 10:59 schrieb Ilya Dryomov: > > On Mon, Jan 10, 2022 at 12:43 PM Peter Lieven wrote: > >> librbd had a bug until early 2022 that affected all versions of ceph that > >> supported fast-diff. Th

Re: [PATCH 2/2] block/rbd: workaround for ceph issue #53784

2022-01-12 Thread Ilya Dryomov
On Mon, Jan 10, 2022 at 12:43 PM Peter Lieven wrote: > > librbd had a bug until early 2022 that affected all versions of ceph that > supported fast-diff. This bug results in reporting of incorrect offsets > if the offset parameter to rbd_diff_iterate2 is not object aligned. > Work around this bug

Re: [PATCH 1/2] block/rbd: fix handling of holes in .bdrv_co_block_status

2022-01-12 Thread Ilya Dryomov
On Mon, Jan 10, 2022 at 12:42 PM Peter Lieven wrote: > > the assumption that we can't hit a hole if we do not diff against a snapshot > was wrong. > > We can see a hole in an image if we diff against base if there exists an > older snapshot > of the image and we have discarded blocks in the imag

Re: [PATCH V3] block/rbd: implement bdrv_co_block_status

2022-01-06 Thread Ilya Dryomov
On Thu, Jan 6, 2022 at 5:33 PM Peter Lieven wrote: > > Am 06.01.22 um 17:01 schrieb Ilya Dryomov: > > On Thu, Jan 6, 2022 at 4:27 PM Peter Lieven wrote: > >> Am 05.10.21 um 10:36 schrieb Ilya Dryomov: > >>> On Tue, Oct 5, 2021 at 10:19 AM Peter Lieven wrote: &g

Re: [PATCH V3] block/rbd: implement bdrv_co_block_status

2022-01-06 Thread Ilya Dryomov
On Thu, Jan 6, 2022 at 4:27 PM Peter Lieven wrote: > > Am 05.10.21 um 10:36 schrieb Ilya Dryomov: > > On Tue, Oct 5, 2021 at 10:19 AM Peter Lieven wrote: > >> Am 05.10.21 um 09:54 schrieb Ilya Dryomov: > >>> On Thu, Sep 16, 2021 at 2:21 PM Peter Lieven

Re: [PATCH V5] block/rbd: implement bdrv_co_block_status

2021-10-17 Thread Ilya Dryomov
* rbd_diff_iterate2 does not invoke callbacks for unallocated > + * areas. This here catches the case where no callback was > + * invoked at all (req.bytes == 0). > + */ > +assert(req.bytes == 0); > +req.bytes = bytes; > +} > +status = BDRV_BLOCK_ZERO | BDRV_BLOCK_OFFSET_VALID; > +} > + > +*pnum = req.bytes; > +return status; > +} > + > static int64_t qemu_rbd_getlength(BlockDriverState *bs) > { > BDRVRBDState *s = bs->opaque; > @@ -1494,6 +1605,7 @@ static BlockDriver bdrv_rbd = { > #ifdef LIBRBD_SUPPORTS_WRITE_ZEROES > .bdrv_co_pwrite_zeroes = qemu_rbd_co_pwrite_zeroes, > #endif > +.bdrv_co_block_status = qemu_rbd_co_block_status, > > .bdrv_snapshot_create = qemu_rbd_snap_create, > .bdrv_snapshot_delete = qemu_rbd_snap_remove, > -- > 2.17.1 > > Reviewed-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH V4] block/rbd: implement bdrv_co_block_status

2021-10-10 Thread Ilya Dryomov
On Thu, Oct 7, 2021 at 6:28 PM Peter Lieven wrote: > > the qemu rbd driver currently lacks support for bdrv_co_block_status. > This results mainly in incorrect progress during block operations (e.g. > qemu-img convert with an rbd image as source). > > This patch utilizes the rbd_diff_iterate2 call

Re: [PATCH V3] block/rbd: implement bdrv_co_block_status

2021-10-05 Thread Ilya Dryomov
On Tue, Oct 5, 2021 at 10:19 AM Peter Lieven wrote: > > Am 05.10.21 um 09:54 schrieb Ilya Dryomov: > > On Thu, Sep 16, 2021 at 2:21 PM Peter Lieven wrote: > >> the qemu rbd driver currently lacks support for bdrv_co_block_status. > >> This results mainly in i

Re: [PATCH V3] block/rbd: implement bdrv_co_block_status

2021-10-05 Thread Ilya Dryomov
On Thu, Sep 16, 2021 at 2:21 PM Peter Lieven wrote: > > the qemu rbd driver currently lacks support for bdrv_co_block_status. > This results mainly in incorrect progress during block operations (e.g. > qemu-img convert with an rbd image as source). > > This patch utilizes the rbd_diff_iterate2 cal

Re: [PATCH V2] block/rbd: implement bdrv_co_block_status

2021-09-05 Thread Ilya Dryomov
On Thu, Sep 2, 2021 at 4:12 PM Peter Lieven wrote: > > Am 24.08.21 um 22:39 schrieb Ilya Dryomov: > > On Mon, Aug 23, 2021 at 11:38 AM Peter Lieven wrote: > >> Am 22.08.21 um 23:02 schrieb Ilya Dryomov: > >>> On Tue, Aug 10, 2021 at 3:41 PM Peter Lieven

Re: [PATCH V2] block/rbd: implement bdrv_co_block_status

2021-08-24 Thread Ilya Dryomov
On Mon, Aug 23, 2021 at 11:38 AM Peter Lieven wrote: > > Am 22.08.21 um 23:02 schrieb Ilya Dryomov: > > On Tue, Aug 10, 2021 at 3:41 PM Peter Lieven wrote: > >> the qemu rbd driver currently lacks support for bdrv_co_block_status. > >> This results mainly in i

Re: [PATCH V2] block/rbd: implement bdrv_co_block_status

2021-08-22 Thread Ilya Dryomov
On Tue, Aug 10, 2021 at 3:41 PM Peter Lieven wrote: > > the qemu rbd driver currently lacks support for bdrv_co_block_status. > This results mainly in incorrect progress during block operations (e.g. > qemu-img convert with an rbd image as source). > > This patch utilizes the rbd_diff_iterate2 cal

Re: [PATCH] MAINTAINERS: update block/rbd.c maintainer

2021-07-08 Thread Ilya Dryomov
44 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -3058,6 +3058,7 @@ F: block/vmdk.c > > RBD > M: Ilya Dryomov > +R: Peter Lieven > L: qemu-bl...@nongnu.org > S: Supported > F: block/rbd.c > -- > 2.17.1 > > Nit: I would change the title to "M

Re: [PATCH] block/rbd: fix type of task->complete

2021-07-08 Thread Ilya Dryomov
1; > +task->complete = true; > aio_co_wake(task->co); > } > > -- > 2.17.1 > > Reviewed-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH v5 0/6] block/rbd: migrate to coroutines and add write zeroes support

2021-07-02 Thread Ilya Dryomov
On Fri, Jul 2, 2021 at 7:24 PM Ilya Dryomov wrote: > > This series migrates the qemu rbd driver from the old aio emulation > to native coroutines and adds write zeroes support which is important > for block operations. > > To achieve this we first bump the librbd requirem

[PATCH v5 5/6] block/rbd: add write zeroes support

2021-07-02 Thread Ilya Dryomov
From: Peter Lieven This patch wittingly sets BDRV_REQ_NO_FALLBACK and silently ignores BDRV_REQ_MAY_UNMAP for older librbd versions. The rationale for this is as follows (citing Ilya Dryomov current RBD maintainer): ---8<--- a) remove the BDRV_REQ_MAY_UNMAP check in qemu_rbd_co_pwrite_zer

[PATCH v5 4/6] block/rbd: migrate from aio to coroutines

2021-07-02 Thread Ilya Dryomov
From: Peter Lieven Signed-off-by: Peter Lieven Reviewed-by: Ilya Dryomov --- block/rbd.c | 252 +++- 1 file changed, 90 insertions(+), 162 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index e2028d3db5ff..380ad28861ad 100644 --- a/block

[PATCH v5 6/6] block/rbd: drop qemu_rbd_refresh_limits

2021-07-02 Thread Ilya Dryomov
From: Peter Lieven librbd supports 1 byte alignment for all aio operations. Currently, there is no API call to query limits from the Ceph ObjectStore backend. So drop the bdrv_refresh_limits completely until there is such an API call. Signed-off-by: Peter Lieven Reviewed-by: Ilya Dryomov

[PATCH v5 1/6] block/rbd: bump librbd requirement to luminous release

2021-07-02 Thread Ilya Dryomov
ed-by: Ilya Dryomov --- block/rbd.c | 120 meson.build | 7 ++- 2 files changed, 13 insertions(+), 114 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index f51adb364670..b4b928bbb99f 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -55,24 +

[PATCH v5 2/6] block/rbd: store object_size in BDRVRBDState

2021-07-02 Thread Ilya Dryomov
From: Peter Lieven Signed-off-by: Peter Lieven Reviewed-by: Ilya Dryomov --- block/rbd.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index b4b928bbb99f..1ebf8f7e4875 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -102,6

[PATCH v5 0/6] block/rbd: migrate to coroutines and add write zeroes support

2021-07-02 Thread Ilya Dryomov
This series migrates the qemu rbd driver from the old aio emulation to native coroutines and adds write zeroes support which is important for block operations. To achieve this we first bump the librbd requirement to the already outdated luminous release of ceph to get rid of some wrappers and ifde

[PATCH v5 3/6] block/rbd: update s->image_size in qemu_rbd_getlength

2021-07-02 Thread Ilya Dryomov
From: Peter Lieven While at it just call rbd_get_size and avoid rbd_image_info_t. Signed-off-by: Peter Lieven Reviewed-by: Ilya Dryomov --- block/rbd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index 1ebf8f7e4875..e2028d3db5ff 100644

Re: [PATCH V4 0/6] block/rbd: migrate to coroutines and add write zeroes support

2021-07-02 Thread Ilya Dryomov
On Fri, Jul 2, 2021 at 11:09 AM Peter Lieven wrote: > > this series migrates the qemu rbd driver from the old aio emulation > to native coroutines and adds write zeroes support which is important > for block operations. > > To achive this we first bump the librbd requirement to the already > outda

Re: [PATCH V4 5/6] block/rbd: add write zeroes support

2021-07-02 Thread Ilya Dryomov
On Fri, Jul 2, 2021 at 11:09 AM Peter Lieven wrote: > > this patch wittingly sets BDRV_REQ_NO_FALLBACK and silently ignores > BDRV_REQ_MAY_UNMAP > for older librbd versions. > > The rationale for this is as following (citing Ilya Dryomov current RBD > maintainer): >

Re: [PATCH V4 4/6] block/rbd: migrate from aio to coroutines

2021-07-02 Thread Ilya Dryomov
AIO_FLUSH); > +return qemu_rbd_start_co(bs, offset, count, NULL, 0, RBD_AIO_DISCARD); > } > > static int qemu_rbd_getinfo(BlockDriverState *bs, BlockDriverInfo *bdi) > @@ -1114,16 +1053,6 @@ static int qemu_rbd_snap_list(BlockDriverState *bs, > return snap_count; > } &g

Re: [PATCH V4 3/6] block/rbd: update s->image_size in qemu_rbd_getlength

2021-07-02 Thread Ilya Dryomov
n s->image_size; > } > > static int coroutine_fn qemu_rbd_co_truncate(BlockDriverState *bs, > -- > 2.17.1 > > Reviewed-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH V4 1/6] block/rbd: bump librbd requirement to luminous release

2021-07-02 Thread Ilya Dryomov
-#endif > > .bdrv_snapshot_create = qemu_rbd_snap_create, > .bdrv_snapshot_delete = qemu_rbd_snap_remove, > .bdrv_snapshot_list = qemu_rbd_snap_list, > .bdrv_snapshot_goto = qemu_rbd_snap_rollback, > -#ifdef LIBRBD_SUPPORTS_INVALIDATE > .bdrv_co_invalidate_cache = qemu_rbd_co_invalidate_cache, > -#endif > > .strong_runtime_opts= qemu_rbd_strong_runtime_opts, > }; > diff --git a/meson.build b/meson.build > index db6789af9c..eb150c70f7 100644 > --- a/meson.build > +++ b/meson.build > @@ -706,13 +706,16 @@ if not get_option('rbd').auto() or have_block >int main(void) { > rados_t cluster; > rados_create(&cluster, NULL); > +#if LIBRBD_VERSION_CODE < LIBRBD_VERSION(1, 12, 0) > +#error > +#endif > return 0; >}''', dependencies: [librbd, librados]) >rbd = declare_dependency(dependencies: [librbd, librados]) > elif get_option('rbd').enabled() > - error('could not link librados') > + error('librbd >= 1.12.0 required') > else > - warning('could not link librados, disabling') > + warning('librbd >= 1.12.0 not found, disabling rbd support') > endif >endif > endif > -- > 2.17.1 > > Reviewed-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH v2] block/rbd: Add support for rbd image encryption

2021-06-27 Thread Ilya Dryomov
cipher-alg: The encryption algorithm > +# > +# Since: 6.1 > +## > +{ 'struct': 'RbdEncryptionCreateOptionsLUKSBase', > + 'base': 'RbdEncryptionOptionsLUKSBase', > + 'data': { '*cipher-alg': 'QCryptoCipherAlgorithm' } } > + > +## > +# @RbdEncryptionOptionsLUKS: > +# > +# Since: 6.1 > +## > +{ 'struct': 'RbdEncryptionOptionsLUKS', > + 'base': 'RbdEncryptionOptionsLUKSBase', > + 'data': { } } > + > +## > +# @RbdEncryptionOptionsLUKS2: > +# > +# Since: 6.1 > +## > +{ 'struct': 'RbdEncryptionOptionsLUKS2', > + 'base': 'RbdEncryptionOptionsLUKSBase', > + 'data': { } } > + > +## > +# @RbdEncryptionCreateOptionsLUKS: > +# > +# Since: 6.1 > +## > +{ 'struct': 'RbdEncryptionCreateOptionsLUKS', > + 'base': 'RbdEncryptionCreateOptionsLUKSBase', > + 'data': { } } > + > +## > +# @RbdEncryptionCreateOptionsLUKS2: > +# > +# Since: 6.1 > +## > +{ 'struct': 'RbdEncryptionCreateOptionsLUKS2', > + 'base': 'RbdEncryptionCreateOptionsLUKSBase', > + 'data': { } } > + > +## > +# @RbdEncryptionOptions: > +# > +# Since: 6.1 > +## > +{ 'union': 'RbdEncryptionOptions', > + 'base': { 'format': 'RbdImageEncryptionFormat' }, > + 'discriminator': 'format', > + 'data': { 'luks': 'RbdEncryptionOptionsLUKS', > +'luks2': 'RbdEncryptionOptionsLUKS2' } } > + > +## > +# @RbdEncryptionCreateOptions: > +# > +# Since: 6.1 > +## > +{ 'union': 'RbdEncryptionCreateOptions', > + 'base': { 'format': 'RbdImageEncryptionFormat' }, > + 'discriminator': 'format', > + 'data': { 'luks': 'RbdEncryptionCreateOptionsLUKS', > +'luks2': 'RbdEncryptionCreateOptionsLUKS2' } } > + > ## > # @BlockdevOptionsRbd: > # > @@ -3624,6 +3725,8 @@ > # > # @snapshot: Ceph snapshot name. > # > +# @encrypt: Image encryption options. (Since 6.1) > +# > # @user: Ceph id name. > # > # @auth-client-required: Acceptable authentication modes. > @@ -3646,6 +3749,7 @@ > 'image': 'str', > '*conf': 'str', > '*snapshot': 'str', > +'*encrypt': 'RbdEncryptionOptions', > '*user': 'str', > '*auth-client-required': ['RbdAuthMode'], > '*key-secret': 'str', > @@ -4418,13 +4522,15 @@ > #point to a snapshot. > # @size: Size of the virtual disk in bytes > # @cluster-size: RBD object size > +# @encrypt: Image encryption options. (Since 6.1) > # > # Since: 2.12 > ## > { 'struct': 'BlockdevCreateOptionsRbd', >'data': { 'location': 'BlockdevOptionsRbd', > 'size': 'size', > -'*cluster-size' : 'size' } } > +'*cluster-size' : 'size', > +'*encrypt' :'RbdEncryptionCreateOptions' } } > > ## > # @BlockdevVmdkSubformat: > -- > 2.27.0 > Reviewed-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH] block/rbd: Add support for rbd image encryption

2021-06-27 Thread Ilya Dryomov
On Sun, Jun 27, 2021 at 1:09 PM Or Ozeri wrote: > > Should I still leave the encryption format part of the state, and just not > report it? or should I also remove it from the state? I'd remove it, reverting to the previous version of the patch except instead of fetching the size with rbd_get_si

Re: [PATCH] block/rbd: Add support for rbd image encryption

2021-06-27 Thread Ilya Dryomov
On Sun, Jun 27, 2021 at 10:44 AM Or Ozeri wrote: > > Ilya, > > I fixed according to your suggestions, except for the passphrase zeroing. > Looks like it's not a one-liner, but rather a long list of ifdefs to try and > cover all possible platforms/compilers (this is what I've seen they do in > k5

Re: [PATCH V3 5/6] block/rbd: add write zeroes support

2021-06-26 Thread Ilya Dryomov
On Mon, Jun 21, 2021 at 10:49 AM Peter Lieven wrote: > > Am 18.06.21 um 12:34 schrieb Ilya Dryomov: > > On Fri, Jun 18, 2021 at 11:00 AM Peter Lieven wrote: > >> Am 16.06.21 um 14:34 schrieb Ilya Dryomov: > >>> On Wed, May 19, 2021 at 4:28 PM Peter Lieven w

Re: [PATCH] block/rbd: Add support for rbd image encryption

2021-06-26 Thread Ilya Dryomov
On Mon, Jun 21, 2021 at 4:49 PM Or Ozeri wrote: > > Starting from ceph Pacific, RBD has built-in support for image-level > encryption. > Currently supported formats are LUKS version 1 and 2. > > There are 2 new relevant librbd APIs for controlling encryption, both expect > an > open image contex

Re: [PATCH] block/rbd: Add support for rbd image encryption

2021-06-21 Thread Ilya Dryomov
On Mon, Jun 21, 2021 at 1:27 PM Daniel P. Berrangé wrote: > > On Mon, Jun 21, 2021 at 01:23:46PM +0200, Ilya Dryomov wrote: > > On Mon, Jun 21, 2021 at 1:04 PM Daniel P. Berrangé > > wrote: > > > > > > On Mon, Jun 21, 2021 at 12:59:37PM +0200, Ilya Dryomov wr

Re: [PATCH] block/rbd: Add support for rbd image encryption

2021-06-21 Thread Ilya Dryomov
On Mon, Jun 21, 2021 at 1:04 PM Daniel P. Berrangé wrote: > > On Mon, Jun 21, 2021 at 12:59:37PM +0200, Ilya Dryomov wrote: > > On Mon, Jun 21, 2021 at 10:32 AM Daniel P. Berrangé > > wrote: > > > > > > On Sat, Jun 19, 2021 at 09:44:32PM +0200, Ilya Dryomov

Re: [PATCH] block/rbd: Add support for rbd image encryption

2021-06-21 Thread Ilya Dryomov
On Mon, Jun 21, 2021 at 10:32 AM Daniel P. Berrangé wrote: > > On Sat, Jun 19, 2021 at 09:44:32PM +0200, Ilya Dryomov wrote: > > On Thu, Jun 17, 2021 at 6:05 PM Or Ozeri wrote: > > > > > > Starting from ceph Pacific, RBD has built-in support for image-level >

Re: [PATCH] block/rbd: Add support for rbd image encryption

2021-06-20 Thread Ilya Dryomov
On Sat, Jun 19, 2021 at 9:44 PM Ilya Dryomov wrote: > > On Thu, Jun 17, 2021 at 6:05 PM Or Ozeri wrote: > > > > Starting from ceph Pacific, RBD has built-in support for image-level > > encryption. > > Currently supported formats are LUKS version 1 and 2. > >

Re: [PATCH V3 6/6] block/rbd: drop qemu_rbd_refresh_limits

2021-06-19 Thread Ilya Dryomov
d I/O (with the caveat that those code paths are probably not very well tested). Regardless, I think it is better to do read-modify-write and similar handling in librbd than in QEMU. Reviewed-by: Ilya Dryomov Thanks, Ilya

Re: [PATCH V3 2/6] block/rbd: store object_size in BDRVRBDState

2021-06-19 Thread Ilya Dryomov
c BlockAIOCB *qemu_rbd_aio_flush(BlockDriverState > *bs, > static int qemu_rbd_getinfo(BlockDriverState *bs, BlockDriverInfo *bdi) > { > BDRVRBDState *s = bs->opaque; > -rbd_image_info_t info; > -int r; > - > -r = rbd_stat(s->image, &in

Re: [PATCH V3 3/6] block/rbd: update s->image_size in qemu_rbd_getlength

2021-06-19 Thread Ilya Dryomov
On Wed, May 19, 2021 at 4:26 PM Peter Lieven wrote: > > in case the image size changed we should adjust our internally stored size as > well. > > Signed-off-by: Peter Lieven > --- > block/rbd.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/block/rbd.c b/block/rbd.c > index b4caea4f1b

Re: [PATCH] block/rbd: Add support for rbd image encryption

2021-06-19 Thread Ilya Dryomov
On Thu, Jun 17, 2021 at 6:05 PM Or Ozeri wrote: > > Starting from ceph Pacific, RBD has built-in support for image-level > encryption. > Currently supported formats are LUKS version 1 and 2. > > There are 2 new relevant librbd APIs for controlling encryption, both expect > an > open image contex

Re: [PATCH V3 4/6] block/rbd: migrate from aio to coroutines

2021-06-18 Thread Ilya Dryomov
On Fri, Jun 18, 2021 at 11:07 AM Peter Lieven wrote: > > Am 17.06.21 um 16:43 schrieb Ilya Dryomov: > > On Wed, May 19, 2021 at 4:27 PM Peter Lieven wrote: > >> Signed-off-by: Peter Lieven > >> --- > >> block/rbd.c | 255 ++

Re: [PATCH V3 5/6] block/rbd: add write zeroes support

2021-06-18 Thread Ilya Dryomov
On Fri, Jun 18, 2021 at 11:00 AM Peter Lieven wrote: > > Am 16.06.21 um 14:34 schrieb Ilya Dryomov: > > On Wed, May 19, 2021 at 4:28 PM Peter Lieven wrote: > >> Signed-off-by: Peter Lieven > >> --- > >> block/rbd.c | 37 ++

Re: [PATCH V3 1/6] block/rbd: bump librbd requirement to luminous release

2021-06-18 Thread Ilya Dryomov
On Fri, Jun 18, 2021 at 10:58 AM Peter Lieven wrote: > > Am 16.06.21 um 14:26 schrieb Ilya Dryomov: > > On Wed, May 19, 2021 at 4:26 PM Peter Lieven wrote: > >> even luminous (version 12.2) is unmaintained for over 3 years now. > >> Bump the requirement to get r

Re: [PATCH V3 4/6] block/rbd: migrate from aio to coroutines

2021-06-17 Thread Ilya Dryomov
On Wed, May 19, 2021 at 4:27 PM Peter Lieven wrote: > > Signed-off-by: Peter Lieven > --- > block/rbd.c | 255 ++-- > 1 file changed, 87 insertions(+), 168 deletions(-) > > diff --git a/block/rbd.c b/block/rbd.c > index 97a2ae4c84..0d8612a988 10064

Re: [PATCH V3 5/6] block/rbd: add write zeroes support

2021-06-16 Thread Ilya Dryomov
On Wed, May 19, 2021 at 4:28 PM Peter Lieven wrote: > > Signed-off-by: Peter Lieven > --- > block/rbd.c | 37 - > 1 file changed, 36 insertions(+), 1 deletion(-) > > diff --git a/block/rbd.c b/block/rbd.c > index 0d8612a988..ee13f08a74 100644 > --- a/block/rbd

Re: [PATCH V3 1/6] block/rbd: bump librbd requirement to luminous release

2021-06-16 Thread Ilya Dryomov
On Wed, May 19, 2021 at 4:26 PM Peter Lieven wrote: > > even luminous (version 12.2) is unmaintained for over 3 years now. > Bump the requirement to get rid of the ifdef'ry in the code. > Qemu 6.1 dropped the support for RHEL-7 which was the last supported > OS that required an older librbd. > > S

[PATCH] MAINTAINERS: update block/rbd.c maintainer

2021-05-19 Thread Ilya Dryomov
Jason has moved on from working on RBD and Ceph. I'm taking over his role upstream. Signed-off-by: Ilya Dryomov --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index eab178aeee5e..3e77ac9030fa 100644 --- a/MAINTAINERS