summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2009-05-27 14:48:06 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-27 09:45:23 -0500
commit91a073a975b220447eb64263690f49a5494347cb (patch)
tree5f78791cb376594f953e6586ff8742baab4f0e29 /block
parenta980c98cf1acb3e813428d4f783a8ebd153ef036 (diff)
downloadqemu-91a073a975b220447eb64263690f49a5494347cb.tar.gz
Drop bdrv_create2
This patch converts the remaining users of bdrv_create2 to bdrv_create and removes the now unused function. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block')
-rw-r--r--block/vvfat.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/block/vvfat.c b/block/vvfat.c
index 13960e95a6..6c29f489aa 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2770,6 +2770,8 @@ static BlockDriver vvfat_write_target = {
static int enable_write_target(BDRVVVFATState *s)
{
+ BlockDriver *bdrv_qcow;
+ QEMUOptionParameter *options;
int size = sector2cluster(s, s->sector_count);
s->used_clusters = calloc(size, 1);
@@ -2777,8 +2779,13 @@ static int enable_write_target(BDRVVVFATState *s)
s->qcow_filename = qemu_malloc(1024);
get_tmp_filename(s->qcow_filename, 1024);
- if (bdrv_create2(bdrv_find_format("qcow"),
- s->qcow_filename, s->sector_count, "fat:", NULL, 0) < 0)
+
+ bdrv_qcow = bdrv_find_format("qcow");
+ options = parse_option_parameters("", bdrv_qcow->create_options, NULL);
+ set_option_parameter_int(options, BLOCK_OPT_SIZE, s->sector_count * 512);
+ set_option_parameter(options, BLOCK_OPT_BACKING_FILE, "fat:");
+
+ if (bdrv_create(bdrv_qcow, s->qcow_filename, options) < 0)
return -1;
s->qcow = bdrv_new("");
if (s->qcow == NULL || bdrv_open(s->qcow, s->qcow_filename, 0) < 0)