From: Asias He <asias@redhat.com>
To: seabios@seabios.org
Cc: target-devel@vger.kernel.org, kvm@vger.kernel.org,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel@nongnu.org, Nicholas Bellinger <nab@linux-iscsi.org>,
virtualization@lists.linux-foundation.org,
Kevin O'Connor <kevin@koconnor.net>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>, Asias He <asias@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] virtio-scsi: Pack struct virtio_scsi_{req_cmd, resp_cmd}
Date: Fri, 15 Mar 2013 09:45:16 +0800 [thread overview]
Message-ID: <1363311916-23121-3-git-send-email-asias@redhat.com> (raw)
In-Reply-To: <1363311916-23121-1-git-send-email-asias@redhat.com>
Device needs the exact size of these data structure. Prevent padding.
This fixes guest hang when booting seabios + tcm_vhost.
Signed-off-by: Asias He <asias@redhat.com>
---
src/virtio-scsi.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/virtio-scsi.h b/src/virtio-scsi.h
index bbfbf30..96c3701 100644
--- a/src/virtio-scsi.h
+++ b/src/virtio-scsi.h
@@ -26,7 +26,7 @@ struct virtio_scsi_req_cmd {
u8 prio;
u8 crn;
char cdb[VIRTIO_SCSI_CDB_SIZE];
-};
+} __attribute__((packed));
/* This is the first element of the "in" scatter-gather list. */
struct virtio_scsi_resp_cmd {
@@ -36,7 +36,7 @@ struct virtio_scsi_resp_cmd {
u8 status;
u8 response;
u8 sense[VIRTIO_SCSI_SENSE_SIZE];
-};
+} __attribute__((packed));
#define VIRTIO_SCSI_S_OK 0
--
1.8.1.4
next prev parent reply other threads:[~2013-03-15 1:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-15 1:45 [Qemu-devel] [PATCH 0/2] Fix booting tcm_vhost + seabios Asias He
2013-03-15 1:45 ` [Qemu-devel] [PATCH 1/2] virtio-scsi: Set _DRIVER_OK flag before scsi target scanning Asias He
2013-03-17 9:16 ` Michael S. Tsirkin
2013-03-15 1:45 ` Asias He [this message]
2013-03-15 8:15 ` [Qemu-devel] [PATCH 2/2] virtio-scsi: Pack struct virtio_scsi_{req_cmd, resp_cmd} Paolo Bonzini
2013-03-17 9:16 ` Michael S. Tsirkin
2013-03-17 14:28 ` [Qemu-devel] [PATCH 0/2] Fix booting tcm_vhost + seabios Kevin O'Connor
2013-03-18 21:26 ` Nicholas A. Bellinger
2013-03-19 0:58 ` Asias He
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=1363311916-23121-3-git-send-email-asias@redhat.com \
--to=asias@redhat.com \
--cc=kevin@koconnor.net \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=nab@linux-iscsi.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=seabios@seabios.org \
--cc=stefanha@redhat.com \
--cc=target-devel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.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).