summaryrefslogtreecommitdiff
path: root/tests/virtio-blk-test.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2016-10-07 12:14:27 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2016-10-14 10:06:47 +1100
commit54ce6f22e86977b6e94692d90e13fce6fc9aa641 (patch)
treec06599cb41ed1daaaa581c8f9e11d7839943474e /tests/virtio-blk-test.c
parent44a3dd9b8718a7f0a94053c57782886748a43d7a (diff)
downloadqemu-54ce6f22e86977b6e94692d90e13fce6fc9aa641.tar.gz
qtest: ask endianness of the target in qtest_init()
The target endianness is not deduced anymore from the architecture name but asked directly to the guest, using a new qtest command: "endianness". As it can't change (this is the value of TARGET_WORDS_BIGENDIAN), we store it to not have to ask every time we want to know if we have to byte-swap a value. Signed-off-by: Laurent Vivier <lvivier@redhat.com> CC: Greg Kurz <groug@kaod.org> CC: David Gibson <david@gibson.dropbear.id.au> CC: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/virtio-blk-test.c')
-rw-r--r--tests/virtio-blk-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c
index 3c4fecc1f0..0506917341 100644
--- a/tests/virtio-blk-test.c
+++ b/tests/virtio-blk-test.c
@@ -125,7 +125,7 @@ static inline void virtio_blk_fix_request(QVirtioBlkReq *req)
bool host_endian = false;
#endif
- if (qtest_big_endian() != host_endian) {
+ if (target_big_endian() != host_endian) {
req->type = bswap32(req->type);
req->ioprio = bswap32(req->ioprio);
req->sector = bswap64(req->sector);