[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.10 8/9] block/rbd: do not blindly set bs->
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH for-2.10 8/9] block/rbd: do not blindly set bs->read_only |
Date: |
Fri, 7 Apr 2017 10:52:45 +0100 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Wed, Apr 05, 2017 at 02:28:50PM -0400, Jeff Cody wrote:
> We do not want to just blindly set bs->read_only. The only time
> we need to set it with the current rbd driver, is if we are using an
> rbd snapshot. In that case, we must set it to read-only.
>
> Signed-off-by: Jeff Cody <address@hidden>
> ---
> block/rbd.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/block/rbd.c b/block/rbd.c
> index c5e1aeb..35853c9 100644
> --- a/block/rbd.c
> +++ b/block/rbd.c
> @@ -635,6 +635,7 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict
> *options, int flags,
> goto failed_shutdown;
> }
>
> + /* rbd_open is always r/w */
> r = rbd_open(s->io_ctx, s->image_name, &s->image, s->snap);
> if (r < 0) {
> error_setg_errno(errp, -r, "error reading header from %s",
> @@ -642,10 +643,14 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict
> *options, int flags,
> goto failed_open;
> }
>
> - r = bdrv_set_read_only(bs, (s->snap != NULL), &local_err);
> - if (r < 0) {
> - error_propagate(errp, local_err);
> - goto failed_open;
> + /* If we are using an rbd snapshot, we must be r/o, otherwise
> + * leave as-is */
> + if (s->snap != NULL) {
> + r = bdrv_set_read_only(bs, true, &local_err);
> + if (r < 0) {
> + error_propagate(errp, local_err);
> + goto failed_open;
> + }
This patch series breaks git-bisect(1) for -drive
file.driver=rbd,file.read-only=on since bdrv_set_read_only(bs, false,
&local_err) fails.
Please squash this patch where you added the bdrv_set_read_only() errp
argument.
signature.asc
Description: PGP signature
- Re: [Qemu-devel] [PATCH for-2.10 5/9] block: introduce bdrv_try_set_read_only(), (continued)
[Qemu-devel] [PATCH for-2.10 6/9] block: use bdrv_try_set_read_only() during reopen, Jeff Cody, 2017/04/05
[Qemu-devel] [PATCH for-2.10 7/9] block/rbd - update variable names to more apt names, Jeff Cody, 2017/04/05
[Qemu-devel] [PATCH for-2.10 9/9] block/rbd: Add support for reopen(), Jeff Cody, 2017/04/05
[Qemu-devel] [PATCH for-2.10 8/9] block/rbd: do not blindly set bs->read_only, Jeff Cody, 2017/04/05
- Re: [Qemu-devel] [PATCH for-2.10 8/9] block/rbd: do not blindly set bs->read_only,
Stefan Hajnoczi <=