diff options
Diffstat (limited to 'block/vvfat.c')
-rw-r--r-- | block/vvfat.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/block/vvfat.c b/block/vvfat.c index c6bf67e8f3..7f230be006 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -2968,6 +2968,7 @@ static void write_target_close(BlockDriverState *bs) { static BlockDriver vvfat_write_target = { .format_name = "vvfat_write_target", + .instance_size = sizeof(void*), .bdrv_co_pwritev = write_target_commit, .bdrv_close = write_target_close, }; @@ -3036,14 +3037,13 @@ static int enable_write_target(BlockDriverState *bs, Error **errp) unlink(s->qcow_filename); #endif - backing = bdrv_new(); + backing = bdrv_new_open_driver(&vvfat_write_target, NULL, BDRV_O_ALLOW_RDWR, + &error_abort); + *(void**) backing->opaque = s; + bdrv_set_backing_hd(s->bs, backing); bdrv_unref(backing); - s->bs->backing->bs->drv = &vvfat_write_target; - s->bs->backing->bs->opaque = g_new(void *, 1); - *(void**)s->bs->backing->bs->opaque = s; - return 0; err: |