MaartenZuidland

PArallels 5.6 fix

May 5th, 2020
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 7.06 KB | None | 0 0
  1. diff -puNr --no-dereference kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs_compat.h kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs_compat.h
  2. --- kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs_compat.h    2020-04-13 16:02:55.000000000 +0400
  3. +++ kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs_compat.h    2020-04-27 13:35:01.822214502 +0400
  4. @@ -11,7 +11,11 @@
  5.  
  6.  static struct proc_dir_entry *
  7.  prlfs_proc_create(char *name, umode_t mode, struct proc_dir_entry *parent,
  8. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
  9.                    struct file_operations *fops)
  10. +#else
  11. +                  struct proc_ops *fops)
  12. +#endif
  13.  {
  14.  #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
  15.     struct proc_dir_entry *p = create_proc_entry(name, mode, parent);
  16. diff -puNr --no-dereference kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c
  17. --- kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c   2020-04-13 16:02:55.000000000 +0400
  18. +++ kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c   2020-04-27 13:35:58.192803858 +0400
  19. @@ -517,12 +517,20 @@ static int proc_sf_open(struct inode *in
  20.     return seq_open(file, &seq_sf_op);
  21.  }
  22.  
  23. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
  24.  static struct file_operations proc_sf_operations = {
  25.     .owner      = THIS_MODULE,
  26.     .open       = proc_sf_open,
  27.     .read       = seq_read,
  28.     .llseek     = seq_lseek,
  29.     .release    = seq_release,
  30. +#else
  31. +static struct proc_ops proc_sf_operations = {
  32. +   .proc_open  = proc_sf_open,
  33. +   .proc_read  = seq_read,
  34. +   .proc_lseek = seq_lseek,
  35. +   .proc_release   = seq_release,
  36. +#endif
  37.  };
  38.  
  39.  static int prlfs_proc_init(void)
  40. diff -puNr --no-dereference kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c
  41. --- kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c 2020-04-13 16:02:55.000000000 +0400
  42. +++ kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c 2020-04-27 13:37:24.531158555 +0400
  43. @@ -347,6 +347,7 @@ int freeze_open(struct inode *inode, str
  44.     return seq_open(file, &freeze_seq_ops);
  45.  }
  46.  
  47. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
  48.  struct file_operations freeze_ops = {
  49.     .owner      = THIS_MODULE,
  50.     .open       = freeze_open,
  51. @@ -354,6 +355,14 @@ struct file_operations freeze_ops = {
  52.     .write      = freeze_write,
  53.     .llseek     = seq_lseek,
  54.     .release    = seq_release,
  55. +#else
  56. +struct proc_ops freeze_ops = {
  57. +   .proc_open  = freeze_open,
  58. +   .proc_read  = seq_read,
  59. +   .proc_write = freeze_write,
  60. +   .proc_lseek = seq_lseek,
  61. +   .proc_release   = seq_release,
  62. +#endif
  63.  };
  64.  
  65.  int __init init_module(void)
  66. diff -puNr --no-dereference kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prlfs_freeze_compat.h kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prlfs_freeze_compat.h
  67. --- kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prlfs_freeze_compat.h   2020-04-13 16:02:55.000000000 +0400
  68. +++ kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prlfs_freeze_compat.h   2020-04-27 13:37:56.675660533 +0400
  69. @@ -10,7 +10,11 @@
  70.  static struct proc_dir_entry *
  71.  prlfs_freeze_proc_create(char *name, umode_t mode,
  72.                           struct proc_dir_entry *parent,
  73. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
  74.                           struct file_operations *fops)
  75. +#else
  76. +                         struct proc_ops *fops)
  77. +#endif
  78.  {
  79.  #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
  80.     struct proc_dir_entry *p = create_proc_entry(name, mode, parent);
  81. diff -puNr --no-dereference kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c
  82. --- kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c    2020-04-13 16:02:55.000000000 +0400
  83. +++ kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c    2020-04-27 13:41:08.520513311 +0400
  84. @@ -391,7 +391,12 @@ out:
  85.  
  86.  static struct proc_dir_entry *
  87.  prltg_proc_create_data(char *name, umode_t mode, struct proc_dir_entry *parent,
  88. -   struct file_operations *fops, void *data)
  89. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
  90. +   struct file_operations *fops,
  91. +#else
  92. +   struct proc_ops *fops,
  93. +#endif
  94. +   void *data)
  95.  {
  96.  #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
  97.     struct proc_dir_entry *p = create_proc_entry(name, mode, parent);
  98. @@ -406,7 +411,11 @@ prltg_proc_create_data(char *name, umode
  99.  #endif
  100.  }
  101.  
  102. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
  103.  int prl_tg_probe_common(struct pci_dev *pdev, board_t board, struct file_operations *fops)
  104. +#else
  105. +int prl_tg_probe_common(struct pci_dev *pdev, board_t board, struct proc_ops *fops)
  106. +#endif
  107.  {
  108.     struct tg_dev *dev;
  109.     int rc = -ENOMEM;
  110. @@ -510,10 +519,17 @@ static void prl_tg_remove(struct pci_dev
  111.     pci_set_drvdata(pdev, NULL);
  112.  }
  113.  
  114. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
  115.  static struct file_operations prl_tg_fops = {
  116.     .write      = prl_tg_write,
  117.     .open       = prl_tg_open,
  118.     .release    = prl_tg_release,
  119. +#else
  120. +static struct proc_ops prl_tg_fops = {
  121. +   .proc_write = prl_tg_write,
  122. +   .proc_open  = prl_tg_open,
  123. +   .proc_release   = prl_tg_release,
  124. +#endif
  125.  };
  126.  
  127.  static int prl_tg_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  128. diff -puNr --no-dereference kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h
  129. --- kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h 2020-04-13 16:02:55.000000000 +0400
  130. +++ kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h 2020-04-27 13:42:28.641474879 +0400
  131. @@ -188,9 +188,17 @@ tg_out(struct tg_dev *dev, unsigned long
  132.  }
  133.  
  134.  struct pci_dev;
  135. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
  136.  struct file_operations;
  137. +#else
  138. +struct proc_ops;
  139. +#endif
  140.  // Exported functions
  141. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
  142.  int prl_tg_probe_common(struct pci_dev *pdev, board_t board, struct file_operations *fops);
  143. +#else
  144. +int prl_tg_probe_common(struct pci_dev *pdev, board_t board, struct proc_ops *fops);
  145. +#endif
  146.  void prl_tg_remove_common(struct tg_dev *dev);
  147.  #ifdef CONFIG_PM
  148.  int prl_tg_suspend_common(struct tg_dev *dev, pm_message_t state);
  149. diff -puNr --no-dereference kmods/prl_vid/Video/Guest/Linux/kmod/prlvtg.c kmods/prl_vid/Video/Guest/Linux/kmod/prlvtg.c
  150. --- kmods/prl_vid/Video/Guest/Linux/kmod/prlvtg.c   2020-04-13 16:02:55.000000000 +0400
  151. +++ kmods/prl_vid/Video/Guest/Linux/kmod/prlvtg.c   2020-04-27 13:43:38.969089604 +0400
  152. @@ -486,6 +486,7 @@ static int prl_vtg_mmap(struct file *fil
  153.  }
  154.  #endif
  155.  
  156. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
  157.  static struct file_operations prl_vtg_fops = {
  158.     .write      = prl_vtg_write,
  159.  #ifdef HAVE_OLD_IOCTL
  160. @@ -499,6 +500,21 @@ static struct file_operations prl_vtg_fo
  161.  #ifdef PRLVTG_MMAP
  162.     .mmap       = prl_vtg_mmap,
  163.  #endif
  164. +#else
  165. +static struct proc_ops prl_vtg_fops = {
  166. +   .proc_write = prl_vtg_write,
  167. +#ifdef HAVE_OLD_IOCTL
  168. +   .proc_compat_ioctl  = prl_vtg_ioctl,
  169. +#endif
  170. +#ifdef HAVE_UNLOCKED_IOCTL
  171. +   .proc_ioctl = prl_vtg_unlocked_ioctl,
  172. +#endif
  173. +   .proc_open      = prl_vtg_open,
  174. +   .proc_release   = prl_vtg_release,
  175. +#ifdef PRLVTG_MMAP
  176. +   .proc_mmap      = prl_vtg_mmap,
  177. +#endif
  178. +#endif
  179.  };
  180.  
  181.  int prl_vtg_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
Add Comment
Please, Sign In to add comment