* [Qemu-devel] [PATCH] sheepdog: remove back pointer to BlockDriverState
@ 2015-08-03 9:52 Paolo Bonzini
2015-08-03 12:40 ` Jeff Cody
2015-08-03 12:48 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
0 siblings, 2 replies; 4+ messages in thread
From: Paolo Bonzini @ 2015-08-03 9:52 UTC (permalink / raw)
To: qemu-devel; +Cc: mitake.hitoshi, namei.unix, jcody, qemu-block
Since sheepdog does not implement a rebind callback, this back pointer
is dangerous. Do not use it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] sheepdog: remove back pointer to BlockDriverState
2015-08-03 9:52 [Qemu-devel] [PATCH] sheepdog: remove back pointer to BlockDriverState Paolo Bonzini
@ 2015-08-03 12:40 ` Jeff Cody
2015-08-03 12:44 ` Paolo Bonzini
2015-08-03 12:48 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
1 sibling, 1 reply; 4+ messages in thread
From: Jeff Cody @ 2015-08-03 12:40 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: mitake.hitoshi, namei.unix, qemu-devel, qemu-block
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 <pbonzini@redhat.com>
> ---
> 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?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] sheepdog: remove back pointer to BlockDriverState
2015-08-03 12:40 ` Jeff Cody
@ 2015-08-03 12:44 ` Paolo Bonzini
0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2015-08-03 12:44 UTC (permalink / raw)
To: Jeff Cody; +Cc: mitake hitoshi, namei unix, qemu-devel, qemu-block
> 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 <pbonzini@redhat.com>
> > ---
> > 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?
No, I don't think so.
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-block] [PATCH] sheepdog: remove back pointer to BlockDriverState
2015-08-03 9:52 [Qemu-devel] [PATCH] sheepdog: remove back pointer to BlockDriverState Paolo Bonzini
2015-08-03 12:40 ` Jeff Cody
@ 2015-08-03 12:48 ` Stefan Hajnoczi
1 sibling, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2015-08-03 12:48 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Hitoshi Mitake, Liu Yuan, qemu-devel, qemu block
On Mon, Aug 3, 2015 at 10:52 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Since sheepdog does not implement a rebind callback, this back pointer
> is dangerous. Do not use it.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> block/sheepdog.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-03 12:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-03 9:52 [Qemu-devel] [PATCH] sheepdog: remove back pointer to BlockDriverState Paolo Bonzini
2015-08-03 12:40 ` Jeff Cody
2015-08-03 12:44 ` Paolo Bonzini
2015-08-03 12:48 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).