Message ID | 20200619120046.2422205-1-stefanha@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/6] vhost-user-server: fix VHOST_MEMORY_MAX_REGIONS compiler error | expand |
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,
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(-)