aboutsummaryrefslogtreecommitdiff
path: root/block/raw-format.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-02-01 20:29:25 +0100
committerMax Reitz <mreitz@redhat.com>2019-02-25 15:11:27 +0100
commit2654267cc163083f4fb9a6d719468d9dd1bea455 (patch)
tree1199e823b53bb502ec14a24041c54dd4703eefc4 /block/raw-format.c
parentc0625e80925302c449bb3f7a7ba6eb213da7c1e2 (diff)
block: Add strong_runtime_opts to BlockDriver
This new field can be set by block drivers to list the runtime options they accept that may influence the contents of the respective BDS. As of a follow-up patch, this list will be used by the common bdrv_refresh_filename() implementation to decide which options to put into BDS.full_open_options (and consequently whether a JSON filename has to be created), thus freeing the drivers of having to implement that logic themselves. Additionally, this patch adds the field to all of the block drivers that need it and sets it accordingly. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 20190201192935.18394-22-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/raw-format.c')
-rw-r--r--block/raw-format.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/block/raw-format.c b/block/raw-format.c
index d07bcdae62..e3e5ba2c8a 100644
--- a/block/raw-format.c
+++ b/block/raw-format.c
@@ -532,6 +532,13 @@ static int coroutine_fn raw_co_copy_range_to(BlockDriverState *bs,
read_flags, write_flags);
}
+static const char *const raw_strong_runtime_opts[] = {
+ "offset",
+ "size",
+
+ NULL
+};
+
BlockDriver bdrv_raw = {
.format_name = "raw",
.instance_size = sizeof(BDRVRawState),
@@ -561,7 +568,8 @@ BlockDriver bdrv_raw = {
.bdrv_lock_medium = &raw_lock_medium,
.bdrv_co_ioctl = &raw_co_ioctl,
.create_opts = &raw_create_opts,
- .bdrv_has_zero_init = &raw_has_zero_init
+ .bdrv_has_zero_init = &raw_has_zero_init,
+ .strong_runtime_opts = raw_strong_runtime_opts,
};
static void bdrv_raw_init(void)