diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2015-09-24 12:55:01 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2015-10-26 10:19:53 +0100 |
commit | f7a199b2b4486242271f769bb4bc2638c0413274 (patch) | |
tree | f63f2b1bc536e1064cabbdf12f0c406f85560643 /contrib/ivshmem-client/ivshmem-client.h | |
parent | 660c97eef6f8f416c5dc24d3798e29f9f9f698fb (diff) |
ivshmem: use little-endian int64_t for the protocol
The current ivshmem protocol uses 'long' for integers. But the
sizeof(long) depends on the host and the endianess is not defined, which
may cause portability troubles.
Instead, switch to using little-endian int64_t. This breaks the
protocol, except on x64 little-endian host where this change
should be compatible.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
Diffstat (limited to 'contrib/ivshmem-client/ivshmem-client.h')
-rw-r--r-- | contrib/ivshmem-client/ivshmem-client.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/ivshmem-client/ivshmem-client.h b/contrib/ivshmem-client/ivshmem-client.h index 9215f3420e..3a4f809682 100644 --- a/contrib/ivshmem-client/ivshmem-client.h +++ b/contrib/ivshmem-client/ivshmem-client.h @@ -43,7 +43,7 @@ */ typedef struct IvshmemClientPeer { QTAILQ_ENTRY(IvshmemClientPeer) next; /**< next in list*/ - long id; /**< the id of the peer */ + int64_t id; /**< the id of the peer */ int vectors[IVSHMEM_CLIENT_MAX_VECTORS]; /**< one fd per vector */ unsigned vectors_count; /**< number of vectors */ } IvshmemClientPeer; @@ -198,7 +198,7 @@ int ivshmem_client_notify_broadcast(const IvshmemClient *client); * Returns: The peer structure, or NULL if not found */ IvshmemClientPeer * -ivshmem_client_search_peer(IvshmemClient *client, long peer_id); +ivshmem_client_search_peer(IvshmemClient *client, int64_t peer_id); /** * Dump information of this ivshmem client on stdout |