mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
Replace calls of old bdrv_open
What is known today as bdrv_open2 becomes the new bdrv_open. All remaining callers of the old function are converted to the new one. In some places they even know the right format, so they should have used bdrv_open2 from the beginning. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
4768fa902c
commit
d6e9098e10
11 changed files with 31 additions and 35 deletions
|
@ -52,7 +52,7 @@ typedef struct {
|
|||
#define QCOW_EXT_MAGIC_END 0
|
||||
#define QCOW_EXT_MAGIC_BACKING_FORMAT 0xE2792ACA
|
||||
|
||||
|
||||
static BlockDriver bdrv_qcow2;
|
||||
|
||||
static int qcow_probe(const uint8_t *buf, int buf_size, const char *filename)
|
||||
{
|
||||
|
@ -1033,7 +1033,7 @@ exit:
|
|||
if (ret == 0 && prealloc) {
|
||||
BlockDriverState *bs;
|
||||
bs = bdrv_new("");
|
||||
bdrv_open(bs, filename, BDRV_O_CACHE_WB | BDRV_O_RDWR);
|
||||
bdrv_open(bs, filename, BDRV_O_CACHE_WB | BDRV_O_RDWR, &bdrv_qcow2);
|
||||
preallocate(bs);
|
||||
bdrv_close(bs);
|
||||
}
|
||||
|
|
|
@ -390,7 +390,7 @@ static int vmdk_parent_open(BlockDriverState *bs, const char * filename)
|
|||
return -1;
|
||||
}
|
||||
parent_open = 1;
|
||||
if (bdrv_open(bs->backing_hd, parent_img_name, 0) < 0)
|
||||
if (bdrv_open(bs->backing_hd, parent_img_name, 0, NULL) < 0)
|
||||
goto failure;
|
||||
parent_open = 0;
|
||||
}
|
||||
|
|
|
@ -2795,8 +2795,11 @@ static int enable_write_target(BDRVVVFATState *s)
|
|||
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, BDRV_O_RDWR) < 0)
|
||||
if (s->qcow == NULL ||
|
||||
bdrv_open(s->qcow, s->qcow_filename, BDRV_O_RDWR, bdrv_qcow) < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
unlink(s->qcow_filename);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue