mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
0dfc7af2b2
commit
12a521b56d
3 changed files with 79 additions and 4 deletions
|
@ -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, \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue