Commit 8ce3f762 authored by Stefano Stabellini's avatar Stefano Stabellini Committed by Boris Ostrovsky

xen/pvcalls: implement listen command

Call inet_listen to implement the listen command.
Signed-off-by: default avatarStefano Stabellini <stefano@aporeto.com>
Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
CC: boris.ostrovsky@oracle.com
CC: jgross@suse.com
Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
parent 331a63e6
...@@ -356,6 +356,27 @@ static int pvcalls_back_bind(struct xenbus_device *dev, ...@@ -356,6 +356,27 @@ static int pvcalls_back_bind(struct xenbus_device *dev,
static int pvcalls_back_listen(struct xenbus_device *dev, static int pvcalls_back_listen(struct xenbus_device *dev,
struct xen_pvcalls_request *req) struct xen_pvcalls_request *req)
{ {
struct pvcalls_fedata *fedata;
int ret = -EINVAL;
struct sockpass_mapping *map;
struct xen_pvcalls_response *rsp;
fedata = dev_get_drvdata(&dev->dev);
down(&fedata->socket_lock);
map = radix_tree_lookup(&fedata->socketpass_mappings, req->u.listen.id);
up(&fedata->socket_lock);
if (map == NULL)
goto out;
ret = inet_listen(map->sock, req->u.listen.backlog);
out:
rsp = RING_GET_RESPONSE(&fedata->ring, fedata->ring.rsp_prod_pvt++);
rsp->req_id = req->req_id;
rsp->cmd = req->cmd;
rsp->u.listen.id = req->u.listen.id;
rsp->ret = ret;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment