* [PATCH 1/2] migration/rdma: define htonll/ntohll only if not predefined
@ 2024-01-11 18:20 Nick Briggs
2024-01-15 4:35 ` Peter Xu
0 siblings, 1 reply; 3+ messages in thread
From: Nick Briggs @ 2024-01-11 18:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Li Zhijian, Peter Xu
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>
---
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.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] migration/rdma: define htonll/ntohll only if not predefined
2024-01-11 18:20 [PATCH 1/2] migration/rdma: define htonll/ntohll only if not predefined Nick Briggs
@ 2024-01-15 4:35 ` Peter Xu
2024-01-15 6:46 ` Nick Briggs
0 siblings, 1 reply; 3+ messages in thread
From: Peter Xu @ 2024-01-15 4:35 UTC (permalink / raw)
To: Nick Briggs; +Cc: qemu-devel, Li Zhijian, Fabiano Rosas
On Thu, Jan 11, 2024 at 01:20:17PM -0500, Nick Briggs wrote:
> 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>
I left the other QGA patch for QGA maintainers, assuming this will enable
solaries build for qemu itself alone.
Queued this one for migration-staging.
Thanks,
--
Peter Xu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] migration/rdma: define htonll/ntohll only if not predefined
2024-01-15 4:35 ` Peter Xu
@ 2024-01-15 6:46 ` Nick Briggs
0 siblings, 0 replies; 3+ messages in thread
From: Nick Briggs @ 2024-01-15 6:46 UTC (permalink / raw)
To: Peter Xu; +Cc: qemu-devel, Li Zhijian, Fabiano Rosas
Thank you.
Yes, with those two patches applied I have compiled qemu on Solaris 11.4 running on a SPARC-T4-1 (sun4v) system to emulate a single target: an HP PA-RISC.
> On Jan 14, 2024, at 8:35 PM, Peter Xu <peterx@redhat.com> wrote:
>
> On Thu, Jan 11, 2024 at 01:20:17PM -0500, Nick Briggs wrote:
>> 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>
>
> I left the other QGA patch for QGA maintainers, assuming this will enable
> solaries build for qemu itself alone.
>
> Queued this one for migration-staging.
>
> Thanks,
>
> --
> Peter Xu
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-15 6:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-11 18:20 [PATCH 1/2] migration/rdma: define htonll/ntohll only if not predefined Nick Briggs
2024-01-15 4:35 ` Peter Xu
2024-01-15 6:46 ` Nick Briggs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).