From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7qmr-0003qe-Fi for qemu-devel@nongnu.org; Wed, 14 Mar 2012 12:11:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7qmN-0004J4-7y for qemu-devel@nongnu.org; Wed, 14 Mar 2012 12:10:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7qmM-0004Ip-Vl for qemu-devel@nongnu.org; Wed, 14 Mar 2012 12:10:23 -0400 Message-ID: <4F60C3C0.4020703@redhat.com> Date: Wed, 14 Mar 2012 17:13:52 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1331740626-5053-1-git-send-email-stefanha@linux.vnet.ibm.com> <1331740626-5053-4-git-send-email-stefanha@linux.vnet.ibm.com> <4F60C1A3.8040506@redhat.com> In-Reply-To: <4F60C1A3.8040506@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 3/3] block: enforce constraints on block size properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Stefan Hajnoczi , qemu-devel@nongnu.org Am 14.03.2012 17:04, schrieb Paolo Bonzini: > Il 14/03/2012 16:57, Stefan Hajnoczi ha scritto: >> Nicolae Mogoreanu 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 >> Reported-by: Michael Halcrow >> Signed-off-by: Stefan Hajnoczi >> --- >> block.h | 8 ++++---- >> 1 files changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/block.h b/block.h >> index 415bb17..3df6c30 100644 >> --- a/block.h >> +++ b/block.h >> @@ -437,10 +437,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), \ > > Reviewed-by: Paolo Bonzini Thanks, applied all. Kevin