qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/6] vhost-user-server: fix VHOST_MEMORY_MAX_REGIONS compiler err


From: Stefan Hajnoczi
Subject: [PATCH 1/6] vhost-user-server: fix VHOST_MEMORY_MAX_REGIONS compiler error
Date: Fri, 19 Jun 2020 13:00:41 +0100

Commit b650d5f4b1cd3f9f8c4fdb319838c5c1e0695e41 ("Lift max ram slots
limit in libvhost-user") renamed this constant. Use the array size
instead of hard-coding a particular constant in the error message.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 util/vhost-user-server.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c
index 393beeb6b9..e94a8d8a83 100644
--- a/util/vhost-user-server.c
+++ b/util/vhost-user-server.c
@@ -137,9 +137,9 @@ vu_message_read(VuDev *vu_dev, int conn_fd, VhostUserMsg 
*vmsg)
         read_bytes += rc;
         if (nfds_t > 0) {
             if (nfds + nfds_t > G_N_ELEMENTS(vmsg->fds)) {
-                error_report("A maximum of %d fds are allowed, "
+                error_report("A maximum of %zu fds are allowed, "
                              "however got %lu fds now",
-                             VHOST_MEMORY_MAX_NREGIONS, nfds + nfds_t);
+                             G_N_ELEMENTS(vmsg->fds), nfds + nfds_t);
                 goto fail;
             }
             memcpy(vmsg->fds + nfds, fds_t,
-- 
2.26.2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]