aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2017-11-02 21:01:22 +0100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2017-12-11 15:32:12 +1100
commit6e925bbb1a0389535263f69b8a8645dcf3ae926e (patch)
treecea92aaa793227af0a5cac727047982f3cfdc589 /lib
parentecda95906930b808b9dca663bb956fd91fb3fea5 (diff)
downloadSLOF-6e925bbb1a0389535263f69b8a8645dcf3ae926e.zip
SLOF-6e925bbb1a0389535263f69b8a8645dcf3ae926e.tar.gz
SLOF-6e925bbb1a0389535263f69b8a8645dcf3ae926e.tar.bz2
libvirtio: Mark struct virtio_scsi_req_cmd as packed
The struct contains an uneven amount of bytes, so we should use the "packed" attribute to avoid padding problems here. So far the problems did not show up yet since the struct is filled by Forth code only and QEMU seems to be quite forgiving about the length of the descriptor, but anyway, let's better be safe than sorry here. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib')
-rw-r--r--lib/libvirtio/virtio-scsi.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libvirtio/virtio-scsi.h b/lib/libvirtio/virtio-scsi.h
index 451ba4d..d598dea 100644
--- a/lib/libvirtio/virtio-scsi.h
+++ b/lib/libvirtio/virtio-scsi.h
@@ -47,7 +47,7 @@ struct virtio_scsi_req_cmd {
uint8_t prio;
uint8_t 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 {