From: "Andreas Färber" <andreas.faerber@web.de>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Andreas Färber" <andreas.faerber@web.de>,
"Anthony Liguori" <aliguori@us.ibm.com>
Subject: [Qemu-devel] [PATCH for-1.1] virtio-blk: Fix unused variables in virtio_blk_handle_scsi()
Date: Sun, 27 May 2012 16:41:30 +0200 [thread overview]
Message-ID: <1338129690-42835-1-git-send-email-andreas.faerber@web.de> (raw)
Commit f34e73cd69bdbdb9b1d56b288c5e14d6fff58165 (virtio-blk: report
non-zero status when failing SG_IO requests) exposed the function
to non-Linux guests. Move all Linux-only variable declarations into
an #ifdef in the variable declaration block.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
---
hw/virtio-blk.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index f9e1896..a1b64cb 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -147,9 +147,12 @@ static VirtIOBlockReq *virtio_blk_get_request(VirtIOBlock *s)
static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
{
- int ret;
int status = VIRTIO_BLK_S_OK;
+#ifdef __linux__
+ struct sg_io_hdr hdr;
+ int ret;
int i;
+#endif
/*
* We require at least one output segment each for the virtio_blk_outhdr
@@ -184,7 +187,6 @@ static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
}
#ifdef __linux__
- struct sg_io_hdr hdr;
memset(&hdr, 0, sizeof(struct sg_io_hdr));
hdr.interface_id = 'S';
hdr.cmd_len = req->elem.out_sg[1].iov_len;
--
1.7.5.3
next reply other threads:[~2012-05-27 14:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-27 14:41 Andreas Färber [this message]
2012-05-27 15:10 ` [Qemu-devel] [PATCH for-1.1] virtio-blk: Fix unused variables in virtio_blk_handle_scsi() Andreas Färber
2012-05-28 12:23 ` 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=1338129690-42835-1-git-send-email-andreas.faerber@web.de \
--to=andreas.faerber@web.de \
--cc=aliguori@us.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).