sheepdog: remove back pointer to BlockDriverState
PATCH 1/1 sheepdog: remove back pointer to BlockDriverState
Since sheepdog does not implement a rebind callback, this back pointer is dangerous. Do not use it.
Signed-off-by Paolo Bonzini <[email protected]>
--- block/sheepdog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
block/sheepdog.c +1 -3
@@ -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);
Signature · 1 line
2.4.3
Quoted 40 lines · Paolo Bonzini
Since sheepdog does not implement a rebind callback, this back pointer is dangerous. Do not use it.
Signed-off-by Paolo Bonzini <[email protected]>--- block/sheepdog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)block/sheepdog.c +1
-3@@ -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);Signature · 1 line
2.4.3
Is this intended for 2.4?
Quoted 37 lines · Paolo Bonzini
Quoted 36 lines
Since sheepdog does not implement a rebind callback, this back pointer is dangerous. Do not use it.
Signed-off-by Paolo Bonzini <[email protected]>--- block/sheepdog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)block/sheepdog.c +1
-2@@ -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 );} };block/sheepdog.c +0
-0@@ -1392,7 +1391,6 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags, Error *local_err =NULL ;const char *filename;
Quoted 8 lines
Quoted 6 lines
block/sheepdog.c +0
-1- s->bs = bs; s->aio_context =bdrv_get_aio_context (bs);opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);--
2.4.3Is this intended for 2.4?
No, I don't think so.
Paolo
Quoted 7 lines · Paolo Bonzini
Since sheepdog does not implement a rebind callback, this back pointer is dangerous. Do not use it.
Signed-off-by Paolo Bonzini <[email protected]>--- block/sheepdog.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Reviewed-by Stefan Hajnoczi <[email protected]>