summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorTetsuya Mukawa <mukawa@igel.co.jp>2015-12-21 12:47:34 +0900
committerMichael S. Tsirkin <mst@redhat.com>2016-01-09 23:20:20 +0200
commit56a571d9c803b7a2348373ca3feb44ca4e0d9131 (patch)
tree81a3cc67130f9b5036f654ff6056ee71b07d5208 /exec.c
parent50e5ae4dc3e4f21e874512f9e87b93b5472d26e0 (diff)
downloadqemu-56a571d9c803b7a2348373ca3feb44ca4e0d9131.tar.gz
qemu-56a571d9c803b7a2348373ca3feb44ca4e0d9131.tar.bz2
qemu-56a571d9c803b7a2348373ca3feb44ca4e0d9131.zip
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>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 8718a75b64..7f0ce42af0 100644
--- a/exec.c
+++ b/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;