[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] sheepdog: remove back pointer to BlockDriverSta
From: |
Jeff Cody |
Subject: |
Re: [Qemu-devel] [PATCH] sheepdog: remove back pointer to BlockDriverState |
Date: |
Mon, 3 Aug 2015 08:40:49 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Aug 03, 2015 at 11:52:37AM +0200, Paolo Bonzini wrote:
> Since sheepdog does not implement a rebind callback, this back pointer
> is dangerous. Do not use it.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> block/sheepdog.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/block/sheepdog.c b/block/sheepdog.c
> index 9585beb..68f1a0d 100644
> --- a/block/sheepdog.c
> +++ b/block/sheepdog.c
> @@ -346,7 +346,6 @@ struct SheepdogAIOCB {
> };
>
> typedef struct BDRVSheepdogState {
> - BlockDriverState *bs;
> AioContext *aio_context;
>
> SheepdogInode inode;
> @@ -738,7 +737,7 @@ static coroutine_fn void reconnect_to_sdog(void *opaque)
> if (s->fd < 0) {
> DPRINTF("Wait for connection to be established\n");
> error_report_err(local_err);
> - co_aio_sleep_ns(bdrv_get_aio_context(s->bs), QEMU_CLOCK_REALTIME,
> + co_aio_sleep_ns(s->aio_context, QEMU_CLOCK_REALTIME,
> 1000000000ULL);
> }
> };
> @@ -1392,7 +1391,6 @@ static int sd_open(BlockDriverState *bs, QDict
> *options, int flags,
> Error *local_err = NULL;
> const char *filename;
>
> - s->bs = bs;
> s->aio_context = bdrv_get_aio_context(bs);
>
> opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
> --
> 2.4.3
>
Is this intended for 2.4?