[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] contrib/ivshmem-server: allow 2G ivshmem region
|
From: |
Erika Hunhoff |
|
Subject: |
[PATCH] contrib/ivshmem-server: allow 2G ivshmem region |
|
Date: |
Thu, 11 May 2023 13:06:39 -0700 |
The ivshmem-server failed when configured with the following:
./ivshmem-server -F -S ivshmem-file -l 2G
This is because the ivshmem_server_ftruncate fails without calling
ftruncate.
This commit allows the ivshmem-server to create a region of size 2G.
Signed-off-by: Erika Hunhoff <hunhoff.erika@gmail.com>
---
contrib/ivshmem-server/ivshmem-server.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/contrib/ivshmem-server/ivshmem-server.c
b/contrib/ivshmem-server/ivshmem-server.c
index 2f3c7320a6..ef31f07914 100644
--- a/contrib/ivshmem-server/ivshmem-server.c
+++ b/contrib/ivshmem-server/ivshmem-server.c
@@ -239,13 +239,17 @@ ivshmem_server_ftruncate(int fd, unsigned shmsize)
return 0;
}
- while (shmsize <= IVSHMEM_SERVER_MAX_HUGEPAGE_SIZE) {
+ /*
+ * This is a do-while loop in case
+ * shmsize > IVSHMEM_SERVER_MAX_HUGEPAGE_SIZE
+ */
+ do {
ret = ftruncate(fd, shmsize);
if (ret == 0) {
return ret;
}
shmsize *= 2;
- }
+ } while (shmsize <= IVSHMEM_SERVER_MAX_HUGEPAGE_SIZE);
return -1;
}
--
2.25.1
| [Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] contrib/ivshmem-server: allow 2G ivshmem region,
Erika Hunhoff <=