diff options
author | Akihiko Odaki <akihiko.odaki@gmail.com> | 2021-07-05 22:04:57 +0900 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2021-07-06 14:28:55 +0100 |
commit | 12a521b56d0538ca0363dd79db8f359cef40da69 (patch) | |
tree | 88d59a52c8e2525549b78b0069810c0650f96942 /include/hw/block | |
parent | 0dfc7af2b287323dde0725c04f5765e0e508d9fd (diff) |
block: Add backend_defaults property
backend_defaults property allow users to control if default block
properties should be decided with backend information.
If it is off, any backend information will be discarded, which is
suitable if you plan to perform live migration to a different disk backend.
If it is on, a block device may utilize backend information more
aggressively.
By default, it is auto, which uses backend information for block
sizes and ignores the others, which is consistent with the older
versions.
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-id: 20210705130458.97642-2-akihiko.odaki@gmail.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/hw/block')
-rw-r--r-- | include/hw/block/block.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/hw/block/block.h b/include/hw/block/block.h index c172cbe65f..5902c0440a 100644 --- a/include/hw/block/block.h +++ b/include/hw/block/block.h @@ -19,6 +19,7 @@ typedef struct BlockConf { BlockBackend *blk; + OnOffAuto backend_defaults; uint32_t physical_block_size; uint32_t logical_block_size; uint32_t min_io_size; @@ -48,6 +49,8 @@ static inline unsigned int get_physical_block_exp(BlockConf *conf) } #define DEFINE_BLOCK_PROPERTIES_BASE(_state, _conf) \ + DEFINE_PROP_ON_OFF_AUTO("backend_defaults", _state, \ + _conf.backend_defaults, ON_OFF_AUTO_AUTO), \ DEFINE_PROP_BLOCKSIZE("logical_block_size", _state, \ _conf.logical_block_size), \ DEFINE_PROP_BLOCKSIZE("physical_block_size", _state, \ |