Revision 9217e26f
b/block/vvfat.c | ||
---|---|---|
2768 | 2768 |
|
2769 | 2769 |
static int write_target_commit(BlockDriverState *bs, int64_t sector_num, |
2770 | 2770 |
const uint8_t* buffer, int nb_sectors) { |
2771 |
BDRVVVFATState* s = bs->opaque;
|
|
2771 |
BDRVVVFATState* s = *((BDRVVVFATState**) bs->opaque);
|
|
2772 | 2772 |
return try_commit(s); |
2773 | 2773 |
} |
2774 | 2774 |
|
2775 | 2775 |
static void write_target_close(BlockDriverState *bs) { |
2776 |
BDRVVVFATState* s = bs->opaque;
|
|
2776 |
BDRVVVFATState* s = *((BDRVVVFATState**) bs->opaque);
|
|
2777 | 2777 |
bdrv_delete(s->qcow); |
2778 | 2778 |
free(s->qcow_filename); |
2779 | 2779 |
} |
... | ... | |
2816 | 2816 |
|
2817 | 2817 |
s->bs->backing_hd = calloc(sizeof(BlockDriverState), 1); |
2818 | 2818 |
s->bs->backing_hd->drv = &vvfat_write_target; |
2819 |
s->bs->backing_hd->opaque = s; |
|
2819 |
s->bs->backing_hd->opaque = qemu_malloc(sizeof(void*)); |
|
2820 |
*(void**)s->bs->backing_hd->opaque = s; |
|
2820 | 2821 |
|
2821 | 2822 |
return 0; |
2822 | 2823 |
} |
Also available in: Unified diff