fix another aliasing problem

scsi_set_uint64 should just use scsi_set_uint32, similar to
what scsi_get_uint64 does.  This avoids problems on architectures
where "uint32_t" requires more alignment than "char", e.g. ARM.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini
2013-08-02 14:07:42 +02:00
parent e7df1af3b9
commit 31a3aeb0e0

View File

@@ -300,11 +300,11 @@ scsi_set_uint64(unsigned char *c, uint64_t v)
uint32_t val;
val = (v >> 32) & 0xffffffff;
*(uint32_t *)c = htonl(val);
scsi_set_uint32(c, val);
c += 4;
val = v & 0xffffffff;
*(uint32_t *)c = htonl(val);
scsi_set_uint32(c, val);
}
inline void