X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fiface-host-dev.c;h=5ef4d16b7521b67bfc37a301486e805b8d854eba;hb=18004a8cb830010315b412162da2d92b95a960ee;hp=191e57e8aaa8b875ff844228e22d37510df73c43;hpb=46c72d0c65a70f0f0d90b9825740bc9335638821;p=palacios.git diff --git a/linux_module/iface-host-dev.c b/linux_module/iface-host-dev.c index 191e57e..5ef4d16 100644 --- a/linux_module/iface-host-dev.c +++ b/linux_module/iface-host-dev.c @@ -127,20 +127,20 @@ struct palacios_host_dev { #define SHALLOW_DEBUG 0 #if DEEP_DEBUG -#define DEEP_DEBUG_PRINT(fmt, args...) printk((fmt), ##args) +#define DEEP_DEBUG_PRINT(fmt, args...) DEBUG((fmt), ##args) #else #define DEEP_DEBUG_PRINT(fmt, args...) #endif #if SHALLOW_DEBUG -#define SHALLOW_DEBUG_PRINT(fmt, args...) printk((fmt), ##args) +#define SHALLOW_DEBUG_PRINT(fmt, args...) INFO((fmt), ##args) #else #define SHALLOW_DEBUG_PRINT(fmt, args...) #endif - -#define ERROR(fmt, args...) printk((fmt), ##args) -#define INFO(fmt, args...) printk((fmt), ##args) +// Moved to palacios.h +//define ERROR(fmt, args...) +//define INFO(fmt, args...) struct palacios_host_device_user { spinlock_t lock; @@ -342,8 +342,7 @@ 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) +static long host_dev_ioctl(struct file * fp, unsigned int val, unsigned long arg) { void __user *argp = (void __user *)arg; @@ -380,8 +379,8 @@ static int host_dev_ioctl(struct inode *ip, struct file *fp, unsigned int val, u return -EFAULT; } - if (v3_host_dev_read_guest_mem(dev->guestdev, - dev, + if (v3_host_dev_read_guest_mem(dev, + dev->guestdev, op.gpa, temp, op.len) != op.len) { @@ -421,8 +420,8 @@ static int host_dev_ioctl(struct inode *ip, struct file *fp, unsigned int val, u return -EFAULT; } - if (v3_host_dev_write_guest_mem(dev->guestdev, - dev, + if (v3_host_dev_write_guest_mem(dev, + dev->guestdev, op.gpa, temp, op.len) != op.len) { @@ -441,7 +440,7 @@ static int host_dev_ioctl(struct inode *ip, struct file *fp, unsigned int val, u DEEP_DEBUG_PRINT("palacios: hostdev: irq guest\n"); - return v3_host_dev_raise_irq(dev->guestdev, dev, op.irq); + return v3_host_dev_raise_irq(dev, dev->guestdev, op.irq); } break; @@ -596,13 +595,11 @@ 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, - .ioctl = host_dev_ioctl, + .compat_ioctl = host_dev_ioctl, + .unlocked_ioctl = host_dev_ioctl, }; @@ -619,7 +616,7 @@ static int host_dev_connect(struct v3_guest * guest, unsigned int cmd, unsigned if (copy_from_user(url, argp, MAX_URL)) { - printk("copy from user error getting url for host device connect...\n"); + ERROR("copy from user error getting url for host device connect...\n"); return -EFAULT; } @@ -753,7 +750,7 @@ static v3_host_dev_t palacios_host_dev_open_deferred(char *url, host_dev = get_vm_ext_data(guest, "HOST_DEVICE_INTERFACE"); if (host_dev == NULL) { - printk("Error locating vm host data for HOST_DEVICE_INTERFACE\n"); + ERROR("Error locating vm host data for HOST_DEVICE_INTERFACE\n"); return 0; }