From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGJjn-0004Ql-8m for qemu-devel@nongnu.org; Thu, 14 Mar 2013 21:47:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGJjk-0006r5-Lu for qemu-devel@nongnu.org; Thu, 14 Mar 2013 21:47:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGJjk-0006qw-Ef for qemu-devel@nongnu.org; Thu, 14 Mar 2013 21:47:12 -0400 From: Asias He Date: Fri, 15 Mar 2013 09:45:16 +0800 Message-Id: <1363311916-23121-3-git-send-email-asias@redhat.com> In-Reply-To: <1363311916-23121-1-git-send-email-asias@redhat.com> References: <1363311916-23121-1-git-send-email-asias@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] virtio-scsi: Pack struct virtio_scsi_{req_cmd, resp_cmd} List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: seabios@seabios.org Cc: target-devel@vger.kernel.org, kvm@vger.kernel.org, "Michael S. Tsirkin" , qemu-devel@nongnu.org, Nicholas Bellinger , virtualization@lists.linux-foundation.org, Kevin O'Connor , Stefan Hajnoczi , Paolo Bonzini , Asias He 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 --- 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