diff options
author | Asias He <asias@redhat.com> | 2013-03-15 09:45:16 +0800 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-05-15 07:47:03 +0200 |
commit | 3b386a5b72a9efe9cf362410feedd3bfc71ff107 (patch) | |
tree | fccbb6a2c7ab91c7ecd700287cb4b377e5c6aa45 | |
parent | 88cb66ea542906ffff8a80ef397b9e3adbb33116 (diff) | |
download | seabios-3b386a5b72a9efe9cf362410feedd3bfc71ff107.zip seabios-3b386a5b72a9efe9cf362410feedd3bfc71ff107.tar.gz seabios-3b386a5b72a9efe9cf362410feedd3bfc71ff107.tar.bz2 |
virtio-scsi: Pack struct virtio_scsi_{req_cmd,resp_cmd}
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)
-rw-r--r-- | src/virtio-scsi.h | 4 |
1 files 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 |