From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/2] block: Add Error argument to bdrv_refresh_limits()
Date: Wed, 16 Jul 2014 21:08:17 +0200 [thread overview]
Message-ID: <20140716190817.GC8802@noname.redhat.com> (raw)
In-Reply-To: <53C6BF4A.6010309@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1942 bytes --]
Am 16.07.2014 um 20:07 hat Eric Blake geschrieben:
> On 07/16/2014 09:48 AM, Kevin Wolf wrote:
> > @@ -1154,7 +1167,7 @@ void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd)
> > bdrv_op_unblock(bs->backing_hd, BLOCK_OP_TYPE_COMMIT,
> > bs->backing_blocker);
> > out:
> > - bdrv_refresh_limits(bs);
> > + bdrv_refresh_limits(bs, NULL);
> > }
> >
> > /*
> > @@ -1778,7 +1791,7 @@ void bdrv_reopen_commit(BDRVReopenState *reopen_state)
> > BDRV_O_CACHE_WB);
> > reopen_state->bs->read_only = !(reopen_state->flags & BDRV_O_RDWR);
> >
> > - bdrv_refresh_limits(reopen_state->bs);
> > + bdrv_refresh_limits(reopen_state->bs, NULL);
>
> > +++ b/block/stream.c
> > @@ -76,7 +76,7 @@ static void close_unused_images(BlockDriverState *top, BlockDriverState *base,
> > bdrv_unref(unused);
> > }
> >
> > - bdrv_refresh_limits(top);
> > + bdrv_refresh_limits(top, NULL);
> > }
> >
>
> Should these three callers be concerned about failure? If so, would
> &error_abort be better than NULL? But as for this patch, you are
> preserving existing semantics, so you could save it for a later patch.
They probably should, but I couldn't figure out what they should to on
failure. Aborting qemu because a single block device fails isn't nice.
&error_abort has similar semantics as assert() for me ("This can't ever
happen"), and this is definitely not the case here as I/O errors can
happen anytime.
If anything, it's similar to a qcow2 image that has detected corruption
and therefore made the BDS unusable. But setting bs->drv = NULL within a
single block driver is already tricky (and so it was buggy at first),
doing it in block.c with BDSes of any driver sounds even worse.
This is the reason why I kept NULL here, even if it's not completely
right.
Kevin
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-07-16 19:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-16 15:48 [Qemu-devel] [PATCH for-2.1 0/2] raw-posix: Fail gracefully if no working alignment is found Kevin Wolf
2014-07-16 15:48 ` [Qemu-devel] [PATCH 1/2] block: Add Error argument to bdrv_refresh_limits() Kevin Wolf
2014-07-16 18:07 ` Eric Blake
2014-07-16 19:08 ` Kevin Wolf [this message]
2014-07-16 15:48 ` [Qemu-devel] [PATCH 2/2] raw-posix: Fail gracefully if no working alignment is found Kevin Wolf
2014-07-16 18:08 ` Eric Blake
2014-07-18 12:22 ` [Qemu-devel] [PATCH for-2.1 0/2] " Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140716190817.GC8802@noname.redhat.com \
--to=kwolf@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.