From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org, xen-devel@lists.xensource.com
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH RESEND 1/4] xen_disk: move sanity check to the correct place
Date: Thu, 11 Jun 2009 11:32:48 +0200 [thread overview]
Message-ID: <1244712771-14432-2-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1244712771-14432-1-git-send-email-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/xen_disk.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index f95e373..659a839 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -179,10 +179,6 @@ static int ioreq_parse(struct ioreq *ioreq)
switch (ioreq->req.operation) {
case BLKIF_OP_READ:
ioreq->prot = PROT_WRITE; /* to memory */
- if (ioreq->req.operation != BLKIF_OP_READ && blkdev->mode[0] != 'w') {
- xen_be_printf(&blkdev->xendev, 0, "error: write req for ro device\n");
- goto err;
- }
break;
case BLKIF_OP_WRITE_BARRIER:
if (!syncwrite)
@@ -199,6 +195,11 @@ static int ioreq_parse(struct ioreq *ioreq)
goto err;
};
+ if (ioreq->req.operation != BLKIF_OP_READ && blkdev->mode[0] != 'w') {
+ xen_be_printf(&blkdev->xendev, 0, "error: write req for ro device\n");
+ goto err;
+ }
+
ioreq->start = ioreq->req.sector_number * blkdev->file_blk;
for (i = 0; i < ioreq->req.nr_segments; i++) {
if (i == BLKIF_MAX_SEGMENTS_PER_REQUEST) {
--
1.6.2.2
next prev parent reply other threads:[~2009-06-11 9:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 9:32 [Qemu-devel] [PATCH RESEND 0/4] xen: misc fixes Gerd Hoffmann
2009-06-11 9:32 ` Gerd Hoffmann [this message]
2009-06-11 9:32 ` [Qemu-devel] [PATCH RESEND 2/4] xen: adapt to qemu_machine changes Gerd Hoffmann
2009-06-11 9:32 ` [Qemu-devel] [PATCH RESEND 3/4] include inttypes.h in xen.h Gerd Hoffmann
2009-06-11 9:32 ` [Qemu-devel] [PATCH RESEND 4/4] xen nic: check tx queue after connect Gerd Hoffmann
2009-06-13 13:41 ` [Qemu-devel] [PATCH RESEND 0/4] xen: misc fixes Blue Swirl
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=1244712771-14432-2-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xen-devel@lists.xensource.com \
/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).