From patchwork Fri Mar 15 01:45:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 2274611 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B469FDFB79 for ; Fri, 15 Mar 2013 01:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753497Ab3COBrQ (ORCPT ); Thu, 14 Mar 2013 21:47:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22747 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753301Ab3COBrP (ORCPT ); Thu, 14 Mar 2013 21:47:15 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2F1l9Sk021410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Mar 2013 21:47:09 -0400 Received: from hj.localdomain.com (vpn1-113-152.nay.redhat.com [10.66.113.152]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2F1jfiG015840; Thu, 14 Mar 2013 21:46:50 -0400 From: Asias He To: seabios@seabios.org Cc: qemu-devel@nongnu.org, "Kevin O'Connor" , Nicholas Bellinger , Paolo Bonzini , Stefan Hajnoczi , "Michael S. Tsirkin" , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, target-devel@vger.kernel.org, Asias He Subject: [PATCH 2/2] virtio-scsi: Pack struct virtio_scsi_{req_cmd, resp_cmd} 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 Reviewed-by: Paolo Bonzini Acked-by: Michael S. Tsirkin --- 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