VHOST_SET_MEM_TABLE failed: Operation not supported
In vhost_set_memory(), We have
if (mem.padding)
return -EOPNOTSUPP;
So, we need to zero struct vhost_memory.
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
if (ndev->vhost_fd < 0)
die_perror("Failed openning vhost-net device");
- mem = malloc(sizeof(*mem) + sizeof(struct vhost_memory_region));
+ mem = calloc(1, sizeof(*mem) + sizeof(struct vhost_memory_region));
if (mem == NULL)
die("Failed allocating memory for vhost memory map");