[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/19] block: Make bdrv_default_refresh_format_filen
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH 06/19] block: Make bdrv_default_refresh_format_filename public |
Date: |
Tue, 26 Apr 2016 23:32:05 +0200 |
In order to allow block drivers to use that function, it needs to be
public. In order to be useful, it needs to take a parameter which allows
the caller to specify whether the runtime options allowed by the block
driver are actually significant for the guest-visible BDS content.
Signed-off-by: Max Reitz <address@hidden>
---
block.c | 9 ++++++---
include/block/block_int.h | 3 +++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/block.c b/block.c
index 511a0b1..b3ff08f 100644
--- a/block.c
+++ b/block.c
@@ -3872,7 +3872,10 @@ static bool append_open_options(QDict *d,
BlockDriverState *bs)
return found_any;
}
-static void bdrv_default_refresh_format_filename(BlockDriverState *bs)
+/* @options_significant must be true if any of the driver-specific runtime
+ * options may change the guest-visible content of the BDS */
+void bdrv_default_refresh_format_filename(BlockDriverState *bs,
+ bool options_significant)
{
BlockDriver *drv = bs->drv;
QDict *opts;
@@ -3885,7 +3888,7 @@ static void
bdrv_default_refresh_format_filename(BlockDriverState *bs)
}
opts = qdict_new();
- has_open_options = append_open_options(opts, bs);
+ has_open_options = append_open_options(opts, bs) && options_significant;
has_open_options |= bs->backing_overridden;
/* If no specific options have been given for this BDS, the filename of
@@ -3997,7 +4000,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
QDECREF(opts);
} else if (bs->file) {
/* Try to reconstruct valid information from the underlying file */
- bdrv_default_refresh_format_filename(bs);
+ bdrv_default_refresh_format_filename(bs, true);
} else if (!bs->full_open_options && qdict_size(bs->options)) {
bdrv_default_refresh_protocol_filename(bs);
}
diff --git a/include/block/block_int.h b/include/block/block_int.h
index d73e9ce..eb3665a 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -532,6 +532,9 @@ BlockDriver *bdrv_probe_all(const uint8_t *buf, int
buf_size,
void bdrv_set_io_limits(BlockDriverState *bs,
ThrottleConfig *cfg);
+void bdrv_default_refresh_format_filename(BlockDriverState *bs,
+ bool options_significant);
+
/**
* bdrv_add_before_write_notifier:
--
2.8.0
- [Qemu-devel] [PATCH 00/19] block: Fix some filename generation issues, Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 02/19] block: Add BDS.backing_overridden, Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 01/19] block: Use children list in bdrv_refresh_filename, Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 04/19] block: Add bdrv_default_refresh_format_filename, Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 03/19] block: Respect backing bs in bdrv_refresh_filename, Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 05/19] block: Add bdrv_default_refresh_protocol_filename, Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 09/19] block: bdrv_get_full_backing_filename_from_...'s ret. val., Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 06/19] block: Make bdrv_default_refresh_format_filename public,
Max Reitz <=
- [Qemu-devel] [PATCH 07/19] qcow2: Implement bdrv_refresh_filename(), Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 10/19] block: bdrv_get_full_backing_filename's ret. val., Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 12/19] block: Fix bdrv_find_backing_image(), Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 08/19] block: Make path_combine() return the path, Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 15/19] quorum: Make bdrv_dirname() return NULL, Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 11/19] block: Add bdrv_make_absolute_filename(), Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 13/19] block: Add bdrv_dirname(), Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 14/19] blkverify: Make bdrv_dirname() return NULL, Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 16/19] block/nbd: Implement bdrv_dirname(), Max Reitz, 2016/04/26
- [Qemu-devel] [PATCH 17/19] block: Use bdrv_dirname() for relative filenames, Max Reitz, 2016/04/26