X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fpalacios-host-dev.c;h=c20e0fa0d253a241998ea8287ae5e35eb48cf0b0;hb=4fdb3bc363a277d32fd95f58358470874b992c53;hp=686c96203adb8ca58c5bd6e28bedd0890d604a11;hpb=5ac6ebe490fe6ebb948dd68736c693a3bb2f82dc;p=palacios.git diff --git a/linux_module/palacios-host-dev.c b/linux_module/palacios-host-dev.c index 686c962..c20e0fa 100644 --- a/linux_module/palacios-host-dev.c +++ b/linux_module/palacios-host-dev.c @@ -266,12 +266,14 @@ static int host_dev_release(struct inode * i, struct file * filp) return 0; } + static int host_dev_ioctl(struct inode *ip, struct file *fp, unsigned int val, unsigned long arg) { void __user *argp = (void __user *)arg; struct palacios_host_device_user *dev = fp->private_data; + if (!dev->connected) { return -EFAULT; } @@ -381,7 +383,7 @@ static int host_dev_ioctl(struct inode *ip, struct file *fp, unsigned int val, u } spin_unlock_irqrestore(&(dev->lock),f); - + return 1; // have request for you } @@ -462,6 +464,8 @@ static int host_dev_ioctl(struct inode *ip, struct file *fp, unsigned int val, u } + + static struct file_operations host_dev_fops = { .poll = host_dev_poll, .release = host_dev_release, @@ -846,7 +850,7 @@ static uint64_t palacios_host_dev_write_io(v3_host_dev_t hostdev, spin_unlock_irqrestore(&(dev->lock),f); return 0; } - + // resize request and response in case they will need it palacios_resize_reqresp(&(dev->req),len,0); // make room for data