On Thu, 17 Oct 2024 09:28:21 +0200 Laurent Vivier <lvivier(a)redhat.com> wrote:On 17/10/2024 02:10, Stefano Brivio wrote:Ah, right, sorry, I just assumed you did that for a reason of size. No, I think const is a nice thing to have for the actual runtime configuration, so I guess it's better to keep it like you did. -- StefanoI did in the past, but the problem here is most of the time ctx is passed to the function as a "const" and vdev (for the virqueues) must be modified (so it's not a const anymore). But I can try again if you think "const" is not important.--- a/vhost_user.c +++ b/vhost_user.c @@ -48,12 +48,13 @@ /* vhost-user version we are compatible with */ #define VHOST_USER_VERSION 1 +static struct vu_dev vdev_storage;I see that struct vu_dev is 1564 bytes (on x86), but struct ctx is 580320 bytes (because of tcp_ctx and udp_ctx), so I wouldn't see a problem if you embedded this directly into struct ctx without a pointer.