[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/20] migration/rdma: define htonll/ntohll only if not predefined
From: |
peterx |
Subject: |
[PULL 20/20] migration/rdma: define htonll/ntohll only if not predefined |
Date: |
Tue, 16 Jan 2024 11:19:47 +0800 |
From: Nick Briggs <nicholas.h.briggs@gmail.com>
Solaris has #defines for htonll and ntohll which cause syntax errors
when compiling code that attempts to (re)define these functions..
Signed-off-by: Nick Briggs <nicholas.h.briggs@gmail.com>
Link: 65a04a7d.497ab3.3e7bef1f@gateway.sonic.net">https://lore.kernel.org/r/65a04a7d.497ab3.3e7bef1f@gateway.sonic.net
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/rdma.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/migration/rdma.c b/migration/rdma.c
index 94c0f871f0..a355dcea89 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -238,6 +238,7 @@ static const char *control_desc(unsigned int rdma_control)
return strs[rdma_control];
}
+#if !defined(htonll)
static uint64_t htonll(uint64_t v)
{
union { uint32_t lv[2]; uint64_t llv; } u;
@@ -245,13 +246,16 @@ static uint64_t htonll(uint64_t v)
u.lv[1] = htonl(v & 0xFFFFFFFFULL);
return u.llv;
}
+#endif
+#if !defined(ntohll)
static uint64_t ntohll(uint64_t v)
{
union { uint32_t lv[2]; uint64_t llv; } u;
u.llv = v;
return ((uint64_t)ntohl(u.lv[0]) << 32) | (uint64_t) ntohl(u.lv[1]);
}
+#endif
static void dest_block_to_network(RDMADestBlock *db)
{
--
2.43.0
- [PULL 10/20] docs/migration: Create migration/ directory, (continued)
- [PULL 10/20] docs/migration: Create migration/ directory, peterx, 2024/01/15
- [PULL 11/20] docs/migration: Create index page, peterx, 2024/01/15
- [PULL 12/20] docs/migration: Convert virtio.txt into rST, peterx, 2024/01/15
- [PULL 14/20] docs/migration: Split "Debugging" and "Firmware", peterx, 2024/01/15
- [PULL 13/20] docs/migration: Split "Backwards compatibility" separately, peterx, 2024/01/15
- [PULL 15/20] docs/migration: Split "Postcopy", peterx, 2024/01/15
- [PULL 17/20] docs/migration: Organize "Postcopy" page, peterx, 2024/01/15
- [PULL 16/20] docs/migration: Split "dirty limit", peterx, 2024/01/15
- [PULL 19/20] docs/migration: Further move virtio to be feature of migration, peterx, 2024/01/15
- [PULL 18/20] docs/migration: Further move vfio to be feature of migration, peterx, 2024/01/15
- [PULL 20/20] migration/rdma: define htonll/ntohll only if not predefined,
peterx <=
- [PULL 05/20] migration: Report error in incoming migration, peterx, 2024/01/15
- Re: [PULL 00/20] Migration 20240116 patches, Peter Maydell, 2024/01/16