]> xenbits.xensource.com Git - seabios.git/commitdiff
virtio-scsi: Pack struct virtio_scsi_{req_cmd,resp_cmd}
authorAsias He <asias@redhat.com>
Fri, 15 Mar 2013 01:45:16 +0000 (09:45 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 15 May 2013 05:47:03 +0000 (07:47 +0200)
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>
(cherry picked from commit b44a7be17bdd270ea029a8e2ec0c2e80c6cd0444)

src/virtio-scsi.h

index bbfbf30b99661f926e9402778134aeb85c310149..96c3701d24cfa75cc1434c44d9461ae69c107681 100644 (file)
@@ -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