tools: Use posix_memalign instead of valloc for NetBSD
PATCH 1/1 tools: Use posix_memalign instead of valloc for NetBSD
More similar to other implementation.posix_memalign was adde in NetBSD 8.0, released on July 17, 2018 and went out of support on May 4, 2024.
--- tools/include/xenctrl.h | 5 +++++ tools/libs/ctrl/xc_netbsd.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-)
tools/include/xenctrl.h +5 -0
@@ -1390,6 +1390,11 @@ int xc_lockprof_query(xc_interface *xch,uint64_t *time, xc_hypercall_buffer_t *data); +/** +* Allocate memory with a given alignment. +* The alignment must be a power of 2 and at least sizeof(void*). +* It returns NULL on error, errno is not set. +*/ void *xc_memalign (xc_interface *xch,size_t alignment,size_t size);/**
tools/libs/ctrl/xc_netbsd.c +8 -1
@@ -60,7 +60,14 @@ void discard_file_cache(xc_interface *xch, int fd, int flush)void *xc_memalign (xc_interface *xch,size_t alignment,size_t size) { -return valloc (size); +int ret; +void *ptr; + + ret =posix_memalign (&ptr, alignment, size); +if (ret !=0 || !ptr) +return NULL ; + +return ptr; }int xc_pcidev_get_gsi (xc_interface *xch,uint32_t sbdf)
Signature · 1 line
2.43.0
Adding Manuel that maintains the NetBSD xen-tools package.
Quoted 49 lines · Frediano Ziglio
More similar to other implementation.
posix_memalignwas adde in NetBSD 8.0, released on July 17, 2018 and went out of support on May 4, 2024.Signed-off-by Frediano Ziglio <[email protected]>--- tools/include/xenctrl.h | 5 +++++ tools/libs/ctrl/xc_netbsd.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-)tools/include/xenctrl.h +5
-0@@ -1390,6 +1390,11 @@ int xc_lockprof_query(xc_interface *xch,uint64_t *time, xc_hypercall_buffer_t *data); +/** +* Allocate memory with a given alignment. +* The alignment must be a power of 2 and at least sizeof(void*). +* It returns NULL on error, errno is not set. +*/ void *xc_memalign (xc_interface *xch,size_t alignment,size_t size);/** tools/libs/ctrl/xc_netbsd.c +8
-1@@ -60,7 +60,14 @@ void discard_file_cache(xc_interface *xch, int fd, int flush)void *xc_memalign (xc_interface *xch,size_t alignment,size_t size) { -return valloc (size); +int ret; +void *ptr; + + ret =posix_memalign (&ptr, alignment, size); +if (ret !=0 || !ptr) +return NULL ; + +return ptr; }int xc_pcidev_get_gsi (xc_interface *xch,uint32_t sbdf)Signature · 1 line
2.43.0
Quoted 1 line · Roger Pau Monné
Adding Manuel that maintains the NetBSD xen-tools package.
thanks
AFAIK this patch is fine
Signature · 3 lines
Manuel Bouyer <[email protected]> NetBSD: 26 ans d'experience feront toujours la difference --
Quoted 49 lines · Roger Pau Monné
Adding Manuel that maintains the NetBSD xen-tools package.
Quoted 45 lines · Frediano Ziglio
More similar to other implementation.
posix_memalignwas adde in NetBSD 8.0, released on July 17, 2018 and went out of support on May 4, 2024.Signed-off-by Frediano Ziglio <[email protected]>--- tools/include/xenctrl.h | 5 +++++ tools/libs/ctrl/xc_netbsd.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-)tools/include/xenctrl.h +5
-0@@ -1390,6 +1390,11 @@ int xc_lockprof_query(xc_interface *xch,uint64_t *time, xc_hypercall_buffer_t *data); +/** +* Allocate memory with a given alignment. +* The alignment must be a power of 2 and at least sizeof(void*). +* It returns NULL on error, errno is not set. +*/ void *xc_memalign (xc_interface *xch,size_t alignment,size_t size);/** tools/libs/ctrl/xc_netbsd.c +8
-1@@ -60,7 +60,14 @@ void discard_file_cache(xc_interface *xch, int fd, int flush)void *xc_memalign (xc_interface *xch,size_t alignment,size_t size) { -return valloc (size); +int ret; +void *ptr; + + ret =posix_memalign (&ptr, alignment, size); +if (ret !=0 || !ptr) +return NULL ; + +return ptr; }
Quoted 4 lines
Quoted 4 lines
tools/libs/ctrl/xc_netbsd.c +0
-1int xc_pcidev_get_gsi (xc_interface *xch,uint32_t sbdf) --2.43.0
I saw Manuel reply almost 2 months ago.
Still pending.
Frediano
Quoted 50 lines · Frediano Ziglio
Quoted 49 lines · Roger Pau Monné
Adding Manuel that maintains the NetBSD xen-tools package.
Quoted 45 lines · Frediano Ziglio
More similar to other implementation.
posix_memalignwas adde in NetBSD 8.0, released on July 17, 2018 and went out of support on May 4, 2024.Signed-off-by Frediano Ziglio <[email protected]>--- tools/include/xenctrl.h | 5 +++++ tools/libs/ctrl/xc_netbsd.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-)tools/include/xenctrl.h +5
-0@@ -1390,6 +1390,11 @@ int xc_lockprof_query(xc_interface *xch,uint64_t *time, xc_hypercall_buffer_t *data); +/** +* Allocate memory with a given alignment. +* The alignment must be a power of 2 and at least sizeof(void*). +* It returns NULL on error, errno is not set. +*/ void *xc_memalign (xc_interface *xch,size_t alignment,size_t size);/** tools/libs/ctrl/xc_netbsd.c +8
-1@@ -60,7 +60,14 @@ void discard_file_cache(xc_interface *xch, int fd, int flush)void *xc_memalign (xc_interface *xch,size_t alignment,size_t size) { -return valloc (size); +int ret; +void *ptr; + + ret =posix_memalign (&ptr, alignment, size); +if (ret !=0 || !ptr) +return NULL ; + +return ptr; }
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
tools/libs/ctrl/xc_netbsd.c +0
-1int xc_pcidev_get_gsi (xc_interface *xch,uint32_t sbdf) --2.43.0
I saw Manuel reply almost 2 months ago.
Still pending.
You understand, though, that Roger can't approve this patch. That'll need to be Anthony. Sending a ping _his_ way is certainly appropriate after this long a time.
Jan
Quoted 60 lines · Jan Beulich
Quoted 50 lines · Frediano Ziglio
Quoted 49 lines · Roger Pau Monné
Adding Manuel that maintains the NetBSD xen-tools package.
Quoted 45 lines · Frediano Ziglio
More similar to other implementation.
posix_memalignwas adde in NetBSD 8.0, released on July 17, 2018 and went out of support on May 4, 2024.Signed-off-by Frediano Ziglio <[email protected]>--- tools/include/xenctrl.h | 5 +++++ tools/libs/ctrl/xc_netbsd.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-)tools/include/xenctrl.h +5
-0@@ -1390,6 +1390,11 @@ int xc_lockprof_query(xc_interface *xch,uint64_t *time, xc_hypercall_buffer_t *data); +/** +* Allocate memory with a given alignment. +* The alignment must be a power of 2 and at least sizeof(void*). +* It returns NULL on error, errno is not set. +*/ void *xc_memalign (xc_interface *xch,size_t alignment,size_t size);/** tools/libs/ctrl/xc_netbsd.c +8
-1@@ -60,7 +60,14 @@ void discard_file_cache(xc_interface *xch, int fd, int flush)void *xc_memalign (xc_interface *xch,size_t alignment,size_t size) { -return valloc (size); +int ret; +void *ptr; + + ret =posix_memalign (&ptr, alignment, size); +if (ret !=0 || !ptr) +return NULL ; + +return ptr; }Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
tools/libs/ctrl/xc_netbsd.c +0
-1int xc_pcidev_get_gsi (xc_interface *xch,uint32_t sbdf) --2.43.0
I saw Manuel reply almost 2 months ago.
Still pending.
Quoted 5 lines
You understand, though, that Roger can't approve this patch. That'll need to be Anthony. Sending a ping _his_ way is certainly appropriate after this long a time.
Jan
Okay, looking at previous exchanges I thought the maintainer was Manuel.
Frediano
Quoted 5 lines · Frediano Ziglio
More similar to other implementation.
posix_memalignwas adde in NetBSD 8.0, released on July 17, 2018 and went out of support on May 4, 2024.Signed-off-by Frediano Ziglio <[email protected]>
Thanks,
--
| Vates
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech