mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-08-27 17:06:01 +00:00
kvm tools: Fix VHOST_SET_MEM_TABLE failure
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>
This commit is contained in:
+1
-1
@@ -471,7 +471,7 @@ static void virtio_net__vhost_init(struct kvm *kvm, struct net_dev *ndev)
|
||||
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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user