[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/8] block/sheepdog: propagate disconnect/reconn
From: |
Liu Yuan |
Subject: |
Re: [Qemu-devel] [PATCH 3/8] block/sheepdog: propagate disconnect/reconnect events to upper driver |
Date: |
Mon, 1 Sep 2014 17:22:19 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Sep 01, 2014 at 10:31:47AM +0200, Benoît Canet wrote:
> The Monday 01 Sep 2014 à 15:43:09 (+0800), Liu Yuan wrote :
> > This is the reference usage how we propagate connection state to upper tier.
> >
> > Cc: Eric Blake <address@hidden>
> > Cc: Benoit Canet <address@hidden>
> > Cc: Kevin Wolf <address@hidden>
> > Cc: Stefan Hajnoczi <address@hidden>
> > Signed-off-by: Liu Yuan <address@hidden>
> > ---
> > block/sheepdog.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/block/sheepdog.c b/block/sheepdog.c
> > index 53c24d6..9c0fc49 100644
> > --- a/block/sheepdog.c
> > +++ b/block/sheepdog.c
> > @@ -714,6 +714,11 @@ static coroutine_fn void reconnect_to_sdog(void
> > *opaque)
> > {
> > BDRVSheepdogState *s = opaque;
> > AIOReq *aio_req, *next;
> > + BlockDriverState *bs = s->bs;
> > +
> > + if (bs->drv_ops && bs->drv_ops->driver_disconnect) {
> > + bs->drv_ops->driver_disconnect(bs);
> > + }
>
> Since this sequence will be strictly the same for all the implementation
> could we create a bdrv_signal_disconnect(bs); in the block layer to make this
> code generic ?
I'm not sure if other protocol driver can have the same auto-reconnection logic.
Probably for simplicity, we keep it as is in the patch. Later when we get more
flesh of implementation of other protocols, we can make a better decision.
Thanks
Yuan
[Qemu-devel] [PATCH 3/8] block/sheepdog: propagate disconnect/reconnect events to upper driver, Liu Yuan, 2014/09/01
[Qemu-devel] [PATCH 4/8] block/quorum: add quorum_aio_release() helper, Liu Yuan, 2014/09/01
[Qemu-devel] [PATCH 5/8] quorum: fix quorum_aio_cancel(), Liu Yuan, 2014/09/01
[Qemu-devel] [PATCH 6/8] block/quorum: add broken state to BlockDriverState, Liu Yuan, 2014/09/01