diff options
author | Max Reitz <mreitz@redhat.com> | 2019-02-01 20:29:25 +0100 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2019-02-25 15:11:27 +0100 |
commit | 2654267cc163083f4fb9a6d719468d9dd1bea455 (patch) | |
tree | 1199e823b53bb502ec14a24041c54dd4703eefc4 /block/nvme.c | |
parent | c0625e80925302c449bb3f7a7ba6eb213da7c1e2 (diff) | |
download | qemu-2654267cc163083f4fb9a6d719468d9dd1bea455.zip |
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/nvme.c')
-rw-r--r-- | block/nvme.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/block/nvme.c b/block/nvme.c index 6c2ce7dfa5..bf656b2bba 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1136,6 +1136,13 @@ static void nvme_unregister_buf(BlockDriverState *bs, void *host) qemu_vfio_dma_unmap(s->vfio, host); } +static const char *const nvme_strong_runtime_opts[] = { + NVME_BLOCK_OPT_DEVICE, + NVME_BLOCK_OPT_NAMESPACE, + + NULL +}; + static BlockDriver bdrv_nvme = { .format_name = "nvme", .protocol_name = "nvme", @@ -1153,6 +1160,7 @@ static BlockDriver bdrv_nvme = { .bdrv_refresh_filename = nvme_refresh_filename, .bdrv_refresh_limits = nvme_refresh_limits, + .strong_runtime_opts = nvme_strong_runtime_opts, .bdrv_detach_aio_context = nvme_detach_aio_context, .bdrv_attach_aio_context = nvme_attach_aio_context, |