summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell2020-03-26 16:44:26 +0100
committerPeter Maydell2020-03-26 16:44:26 +0100
commit762fa6d79aa30e1a713444da0399739423f8d00e (patch)
tree3ca5e53fa28073170829a5e8f82c1aa0b10c0702 /include
parentMerge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20200325b'... (diff)
parentiotests/138: Test leaks/corruptions fixed report (diff)
downloadqemu-762fa6d79aa30e1a713444da0399739423f8d00e.tar.gz
qemu-762fa6d79aa30e1a713444da0399739423f8d00e.tar.xz
qemu-762fa6d79aa30e1a713444da0399739423f8d00e.zip
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-03-26' into staging
Block patches for 5.0-rc1: - Fix qemu-img convert with a host device or iscsi target - Use-after-free fix in mirror - Some minor qcow2 fixes - Minor sheepdog fix - Minor qemu-img check report fix # gpg: Signature made Thu 26 Mar 2020 14:28:26 GMT # gpg: using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40 # gpg: issuer "mreitz@redhat.com" # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full] # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 * remotes/maxreitz/tags/pull-block-2020-03-26: iotests/138: Test leaks/corruptions fixed report iotests: Add poke_file_[bl]e functions qemu-img: Fix check's leak/corruption fix report sheepdog: Consistently set bdrv_has_zero_init_truncate qcow2: Avoid feature name extension on small cluster size qcow2: List autoclear bit names in header qcow2: Comment typo fixes block: trickle down the fallback image creation function use to the block drivers block: pass BlockDriver reference to the .bdrv_co_create block/mirror: fix use after free of local_err Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/block/block.h1
-rw-r--r--include/block/block_int.h14
2 files changed, 14 insertions, 1 deletions
diff --git a/include/block/block.h b/include/block/block.h
index e569a4d747..b05995fe9c 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -283,6 +283,7 @@ BlockDriver *bdrv_find_format(const char *format_name);
int bdrv_create(BlockDriver *drv, const char* filename,
QemuOpts *opts, Error **errp);
int bdrv_create_file(const char *filename, QemuOpts *opts, Error **errp);
+
BlockDriverState *bdrv_new(void);
void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top,
Error **errp);
diff --git a/include/block/block_int.h b/include/block/block_int.h
index ae9c4da4d0..4c3587ea19 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -135,7 +135,8 @@ struct BlockDriver {
void (*bdrv_close)(BlockDriverState *bs);
int coroutine_fn (*bdrv_co_create)(BlockdevCreateOptions *opts,
Error **errp);
- int coroutine_fn (*bdrv_co_create_opts)(const char *filename,
+ int coroutine_fn (*bdrv_co_create_opts)(BlockDriver *drv,
+ const char *filename,
QemuOpts *opts,
Error **errp);
int (*bdrv_make_empty)(BlockDriverState *bs);
@@ -1330,4 +1331,15 @@ int refresh_total_sectors(BlockDriverState *bs, int64_t hint);
void bdrv_set_monitor_owned(BlockDriverState *bs);
BlockDriverState *bds_tree_init(QDict *bs_opts, Error **errp);
+/**
+ * Simple implementation of bdrv_co_create_opts for protocol drivers
+ * which only support creation via opening a file
+ * (usually existing raw storage device)
+ */
+int coroutine_fn bdrv_co_create_opts_simple(BlockDriver *drv,
+ const char *filename,
+ QemuOpts *opts,
+ Error **errp);
+extern QemuOptsList bdrv_create_opts_simple;
+
#endif /* BLOCK_INT_H */