diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-02-08 14:06:14 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-02-22 21:29:44 +0100 |
commit | 215e47b9ea2cd7926333b7dc683024aa00e0c386 (patch) | |
tree | d1ae0848fbdfc0ef88ac9d87abc23171fde3d6cb /hw/block-common.h | |
parent | ded9d2d5e247dc4d141c01bc8dc99d6ec832f9e8 (diff) | |
download | qemu-215e47b9ea2cd7926333b7dc683024aa00e0c386.tar.gz qemu-215e47b9ea2cd7926333b7dc683024aa00e0c386.tar.bz2 qemu-215e47b9ea2cd7926333b7dc683024aa00e0c386.zip |
blockdev: enable discard by default
Because discard is now a host parameter, we can always fake it as enabled
in the guest. This is an extension of the current choice to ignore
"not supported" errors from the host when discard_granularity is set
to nonzero.
The default granularity is set to the logical block size or 4k, whichever
is largest, because cluster sizes below 4k are rarely used and 4K is a
typical block size for files.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/block-common.h')
-rw-r--r-- | hw/block-common.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block-common.h b/hw/block-common.h index bb808f7f56..dd115320c9 100644 --- a/hw/block-common.h +++ b/hw/block-common.h @@ -50,7 +50,7 @@ static inline unsigned int get_physical_block_exp(BlockConf *conf) DEFINE_PROP_UINT32("opt_io_size", _state, _conf.opt_io_size, 0), \ DEFINE_PROP_INT32("bootindex", _state, _conf.bootindex, -1), \ DEFINE_PROP_UINT32("discard_granularity", _state, \ - _conf.discard_granularity, 0) + _conf.discard_granularity, -1) #define DEFINE_BLOCK_CHS_PROPERTIES(_state, _conf) \ DEFINE_PROP_UINT32("cyls", _state, _conf.cyls, 0), \ |