mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
ivshmem: Store file descriptor for vhost-user negotiation
If virtio-net driver allocates memory in ivshmem shared memory, vhost-net will work correctly, but vhost-user will not work because a fd of shared memory will not be sent to vhost-user backend. This patch fixes ivshmem to store file descriptor of shared memory. It will be used when vhost-user negotiates vhost-user backend. Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
50e5ae4dc3
commit
56a571d9c8
3 changed files with 18 additions and 2 deletions
10
exec.c
10
exec.c
|
@ -1757,6 +1757,16 @@ int qemu_get_ram_fd(ram_addr_t addr)
|
|||
return fd;
|
||||
}
|
||||
|
||||
void qemu_set_ram_fd(ram_addr_t addr, int fd)
|
||||
{
|
||||
RAMBlock *block;
|
||||
|
||||
rcu_read_lock();
|
||||
block = qemu_get_ram_block(addr);
|
||||
block->fd = fd;
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
void *qemu_get_ram_block_host_ptr(ram_addr_t addr)
|
||||
{
|
||||
RAMBlock *block;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue