From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH v2 3/3] block: enforce constraints on block size properties
Date: Wed, 14 Mar 2012 15:57:06 +0000 [thread overview]
Message-ID: <1331740626-5053-4-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
In-Reply-To: <1331740626-5053-1-git-send-email-stefanha@linux.vnet.ibm.com>
Nicolae Mogoreanu <mogo@google.com> 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 <mogo@google.com>
Reported-by: Michael Halcrow <mhalcrow@google.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
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), \
--
1.7.9.1
next prev parent reply other threads:[~2012-03-14 15:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-14 15:57 [Qemu-devel] [PATCH v2 0/3] block: enforce constraints on block size properties Stefan Hajnoczi
2012-03-14 15:57 ` [Qemu-devel] [PATCH v2 1/3] qerror: fix QERR_PROPERTY_VALUE_OUT_OF_RANGE description Stefan Hajnoczi
2012-03-14 16:03 ` Paolo Bonzini
2012-03-14 15:57 ` [Qemu-devel] [PATCH v2 2/3] qdev: add blocksize property type Stefan Hajnoczi
2012-03-14 16:04 ` Paolo Bonzini
2012-03-14 15:57 ` Stefan Hajnoczi [this message]
2012-03-14 16:04 ` [Qemu-devel] [PATCH v2 3/3] block: enforce constraints on block size properties Paolo Bonzini
2012-03-14 16:13 ` Kevin Wolf
2012-03-14 17:08 ` [Qemu-devel] [PATCH v2 0/3] " Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331740626-5053-4-git-send-email-stefanha@linux.vnet.ibm.com \
--to=stefanha@linux.vnet.ibm.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).