6 #include "v3_user_host_dev.h"
9 int v3_user_host_dev_rendezvous(char *vmdev, char *url)
14 if ((vmfd=open(vmdev,O_RDWR))<0) {
18 devfd = ioctl(vmfd,V3_VM_HOST_DEV_CONNECT,url);
25 int v3_user_host_dev_depart(int devfd)
31 int v3_user_host_dev_have_request(int devfd)
35 return ioctl(devfd,V3_HOST_DEV_HOST_REQUEST_SIZE_IOCTL,&len)==1;
38 int v3_user_host_dev_pull_request(int devfd, struct palacios_host_dev_host_request_response **req)
43 rc=ioctl(devfd,V3_HOST_DEV_HOST_REQUEST_SIZE_IOCTL,&len);
48 struct palacios_host_dev_host_request_response *r = malloc(len);
50 rc=ioctl(devfd, V3_HOST_DEV_HOST_REQUEST_PULL_IOCTL,r);
63 int v3_user_host_dev_push_response(int devfd, struct palacios_host_dev_host_request_response *resp)
67 rc=ioctl(devfd, V3_HOST_DEV_USER_RESPONSE_PUSH_IOCTL,resp);
78 static uint64_t do_user(int devfd, struct palacios_host_dev_user_op *op)
80 return ioctl(devfd, V3_HOST_DEV_USER_REQUEST_PUSH_IOCTL,op);
83 uint64_t v3_user_host_dev_read_guest_mem(int devfd, void *gpa, void *dest, uint64_t len)
85 struct palacios_host_dev_user_op op;
87 op.type= PALACIOS_HOST_DEV_USER_REQUEST_READ_GUEST;
93 return do_user(devfd,&op);
96 uint64_t v3_user_host_dev_write_guest_mem(int devfd, void *gpa, void *src, uint64_t len)
98 struct palacios_host_dev_user_op op;
100 op.type= PALACIOS_HOST_DEV_USER_REQUEST_WRITE_GUEST;
106 return do_user(devfd,&op);
109 int v3_user_host_dev_inject_irq(int devfd, uint8_t irq)
111 struct palacios_host_dev_user_op op;
113 op.type= PALACIOS_HOST_DEV_USER_REQUEST_IRQ_GUEST;
119 return do_user(devfd,&op);