[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/46] block: enforce constraints on block size prop
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 14/46] block: enforce constraints on block size properties |
Date: |
Thu, 5 Apr 2012 17:51:52 +0200 |
From: Stefan Hajnoczi <address@hidden>
Nicolae Mogoreanu <address@hidden> noticed that I/O requests can lead
to QEMU crashes when the logical_block_size property is smaller than 512
bytes.
Using the new "blocksize" property we can properly enforce constraints
on the block size such that QEMU's block layer is able to operate
correctly.
Reported-by: Nicolae Mogoreanu <address@hidden>
Reported-by: Michael Halcrow <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/block.h b/block.h
index e670606..c51ab16 100644
--- a/block.h
+++ b/block.h
@@ -435,10 +435,10 @@ static inline unsigned int
get_physical_block_exp(BlockConf *conf)
#define DEFINE_BLOCK_PROPERTIES(_state, _conf) \
DEFINE_PROP_DRIVE("drive", _state, _conf.bs), \
- DEFINE_PROP_UINT16("logical_block_size", _state, \
- _conf.logical_block_size, 512), \
- DEFINE_PROP_UINT16("physical_block_size", _state, \
- _conf.physical_block_size, 512), \
+ DEFINE_PROP_BLOCKSIZE("logical_block_size", _state, \
+ _conf.logical_block_size, 512), \
+ DEFINE_PROP_BLOCKSIZE("physical_block_size", _state, \
+ _conf.physical_block_size, 512), \
DEFINE_PROP_UINT16("min_io_size", _state, _conf.min_io_size, 0), \
DEFINE_PROP_UINT32("opt_io_size", _state, _conf.opt_io_size, 0), \
DEFINE_PROP_INT32("bootindex", _state, _conf.bootindex, -1), \
--
1.7.6.5
- [Qemu-devel] [PATCH 42/46] blockdev: open images with BDRV_O_INCOMING on incoming live migration, (continued)
- [Qemu-devel] [PATCH 42/46] blockdev: open images with BDRV_O_INCOMING on incoming live migration, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 25/46] block: fix streaming/closing race, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 36/46] qemu-iotests: Test unknown qcow2 header extensions, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 33/46] sheepdog: implement SD_OP_FLUSH_VDI operation, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 11/46] block/vpc: write checksum back to footer after check, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 15/46] vdi: basic conversion to coroutines, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 09/46] ide: Change serial number strncpy() to pstrcpy(), Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 27/46] block: document job API, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 19/46] vdi: leave bounce buffering to block layer, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 29/46] qed: image fragmentation statistics, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 14/46] block: enforce constraints on block size properties,
Kevin Wolf <=
- [Qemu-devel] [PATCH 12/46] qerror: fix QERR_PROPERTY_VALUE_OUT_OF_RANGE description, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 45/46] qed: honor BDRV_O_INCOMING for incoming live migration, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 44/46] migration: clear BDRV_O_INCOMING flags on end of incoming live migration, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 34/46] sheepdog: fix send req helpers, Kevin Wolf, 2012/04/05
- [Qemu-devel] [PATCH 31/46] qed: track dirty flag status, Kevin Wolf, 2012/04/06
- [Qemu-devel] [PATCH 40/46] block: Add new BDRV_O_INCOMING flag to notice incoming live migration, Kevin Wolf, 2012/04/06
- [Qemu-devel] [PATCH 46/46] qed: remove incoming live migration blocker, Kevin Wolf, 2012/04/06
- [Qemu-devel] [PATCH 16/46] vdi: move end-of-I/O handling at the end, Kevin Wolf, 2012/04/06
- [Qemu-devel] [PATCH 30/46] qemu-img: add dirty flag status, Kevin Wolf, 2012/04/06
- [Qemu-devel] [PATCH 41/46] block: add a function to clear incoming live migration flags, Kevin Wolf, 2012/04/06