Revision 91a073a9 block/vvfat.c
b/block/vvfat.c | ||
---|---|---|
2770 | 2770 |
|
2771 | 2771 |
static int enable_write_target(BDRVVVFATState *s) |
2772 | 2772 |
{ |
2773 |
BlockDriver *bdrv_qcow; |
|
2774 |
QEMUOptionParameter *options; |
|
2773 | 2775 |
int size = sector2cluster(s, s->sector_count); |
2774 | 2776 |
s->used_clusters = calloc(size, 1); |
2775 | 2777 |
|
... | ... | |
2777 | 2779 |
|
2778 | 2780 |
s->qcow_filename = qemu_malloc(1024); |
2779 | 2781 |
get_tmp_filename(s->qcow_filename, 1024); |
2780 |
if (bdrv_create2(bdrv_find_format("qcow"), |
|
2781 |
s->qcow_filename, s->sector_count, "fat:", NULL, 0) < 0) |
|
2782 |
|
|
2783 |
bdrv_qcow = bdrv_find_format("qcow"); |
|
2784 |
options = parse_option_parameters("", bdrv_qcow->create_options, NULL); |
|
2785 |
set_option_parameter_int(options, BLOCK_OPT_SIZE, s->sector_count * 512); |
|
2786 |
set_option_parameter(options, BLOCK_OPT_BACKING_FILE, "fat:"); |
|
2787 |
|
|
2788 |
if (bdrv_create(bdrv_qcow, s->qcow_filename, options) < 0) |
|
2782 | 2789 |
return -1; |
2783 | 2790 |
s->qcow = bdrv_new(""); |
2784 | 2791 |
if (s->qcow == NULL || bdrv_open(s->qcow, s->qcow_filename, 0) < 0) |
Also available in: Unified diff