- drop obsolete and outdated manual inclusion of rpm macros
[packages/VMware-server.git] / VMware-server-linux-2.6.30.patch
1 diff -Naur ./vmci-only/Makefile.org ./vmci-only/Makefile
2 --- ./vmci-only/Makefile.org    2009-06-16 14:05:27.466108603 +0200
3 +++ ./vmci-only/Makefile        2009-06-16 14:06:46.661080248 +0200
4 @@ -113,7 +113,7 @@
5  
6  vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
7         $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
8 -       $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
9 +       $(EXTRA_CFLAGS) -Iinclude -Iinclude2/asm/mach-default \
10         -DKBUILD_BASENAME=\"$(DRIVER)\" \
11         -Werror -S -o /dev/null -xc $(1) \
12         > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
13 diff -Naur ./vmmon-only/linux/driver.c.org ./vmmon-only/linux/driver.c
14 --- ./vmmon-only/linux/driver.c.org     2009-06-16 14:00:30.039078851 +0200
15 +++ ./vmmon-only/linux/driver.c 2009-06-16 14:09:41.715105671 +0200
16 @@ -1984,10 +1984,17 @@
17     }
18  
19     case IOCTL_VMX86_ALLOW_CORE_DUMP:
20 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
21        if (current->euid == current->uid &&
22           current->fsuid == current->uid &&
23            current->egid == current->gid &&
24           current->fsgid == current->gid) {
25 +#else
26 +      if (current_euid() == current_uid() &&
27 +         current_fsuid() == current_uid() &&
28 +          current_egid() == current_gid() &&
29 +         current_fsgid() == current_gid()) {
30 +#endif
31  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) || defined(MMF_DUMPABLE)
32           /* Dump core, readable by user. */
33           set_bit(MMF_DUMPABLE, &current->mm->flags);
34 diff -Naur ./vmmon-only/linux/hostif.c.org ./vmmon-only/linux/hostif.c
35 --- ./vmmon-only/linux/hostif.c.org     2009-06-16 14:00:44.806106788 +0200
36 +++ ./vmmon-only/linux/hostif.c 2009-06-16 14:18:30.693079131 +0200
37 @@ -3422,6 +3422,86 @@
38     }
39     return -ENOIOCTLCMD;
40  }
41 +/* krellan: Linux 2.6.29 compatibility functions for capabilities */
42 +/* Errors are logged but otherwise ignored */
43 +
44 +void compat_cap_raise(int cap)
45 +{
46 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
47 +  cap_raise(current->cap_effective, cap);
48 +#else
49 +  struct cred *new_cred;
50 +  
51 +  new_cred = prepare_creds();
52 +  if (new_cred != NULL)
53 +  {
54 +    cap_raise(new_cred->cap_effective, cap);
55 +    commit_creds(new_cred);
56 +  }
57 +  else
58 +  {
59 +    Log("compat_cap_raise(%d) prepare_creds(): Out of memory\n", cap);
60 +  }
61 +#endif
62 +}
63 +
64 +void compat_cap_lower(int cap)
65 +{
66 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
67 +  cap_lower(current->cap_effective, cap);
68 +#else
69 +  struct cred *new_cred;
70 +  
71 +  new_cred = prepare_creds();
72 +  if (new_cred != NULL)
73 +  {
74 +    cap_lower(new_cred->cap_effective, cap);
75 +    commit_creds(new_cred);
76 +  }
77 +  else
78 +  {
79 +    Log("compat_cap_lower(%d) prepare_creds(): Out of memory\n", cap);
80 +  }
81 +#endif
82 +}
83 +
84 +int compat_cap_raised(int cap)
85 +{
86 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
87 +  return cap_raised(current->cap_effective, cap);
88 +#else
89 +  return cap_raised(current_cap(), cap);
90 +#endif
91 +}
92 +
93 +int compat_get_fsuid(void)
94 +{
95 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
96 +  return current->fsuid;
97 +#else
98 +  return current_fsuid();
99 +#endif
100 +}
101 +
102 +void compat_set_fsuid(int fsuid)
103 +{
104 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
105 +  current->fsuid = fsuid;
106 +#else
107 +  struct cred *new_cred;
108 +  
109 +  new_cred = prepare_creds();
110 +  if (new_cred != NULL)
111 +  {
112 +    new_cred->fsuid = fsuid;
113 +    commit_creds(new_cred);
114 +  }
115 +  else
116 +  {
117 +    Log("compat_set_fsuid(%d) prepare_creds(): Out of memory\n", fsuid);
118 +  }
119 +#endif
120 +}
121  
122  
123  /*
124 @@ -3456,7 +3536,7 @@
125     oldFS = get_fs();
126     set_fs(KERNEL_DS);
127     compat_allow_signal(SIGKILL);
128 -   cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
129 +   compat_cap_raise(CAP_SYS_RESOURCE);
130     compat_set_user_nice(current, linuxState.fastClockPriority);
131  
132     while (linuxState.fastClockRate > HZ + HZ/16) {
133 @@ -3580,19 +3660,19 @@
134           Bool cap;
135           long pid;
136  
137 -         fsuid = current->fsuid;
138 -         current->fsuid = 0;
139 +         fsuid = compat_get_fsuid();
140 +         compat_set_fsuid(0);         
141           filp = filp_open("/dev/rtc", O_RDONLY, 0);
142 -         current->fsuid = fsuid;
143 +         compat_set_fsuid(fsuid);
144           if (IS_ERR(filp)) {
145              Warning("/dev/rtc open failed: %d\n", (int)(VA)filp);
146              return -(int)(VA)filp;
147           }
148 -         cap = cap_raised(current->cap_effective, CAP_SYS_RESOURCE);
149 -         cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
150 +         cap = compat_cap_raised(CAP_SYS_RESOURCE);
151 +         compat_cap_raise(CAP_SYS_RESOURCE);
152           res = HostIFDoIoctl(filp, RTC_PIE_ON, 0);
153           if (!cap) {
154 -            cap_lower(current->cap_effective, CAP_SYS_RESOURCE);            
155 +            compat_cap_lower(CAP_SYS_RESOURCE);
156           }
157           if (res < 0) {
158              Warning("/dev/rtc enable interrupt failed: %d\n", res);
159 diff -Naur ./vmmon-only/include/x86svm.h.org ./vmmon-only/include/x86svm.h
160 --- ./vmmon-only/include/x86svm.h.org   2009-06-16 14:00:11.623087791 +0200
161 +++ ./vmmon-only/include/x86svm.h       2009-06-16 14:04:32.344079689 +0200
162 @@ -47,11 +47,14 @@
163  #endif
164  
165  /* SVM related MSRs */
166 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
167  #define MSR_VM_CR                  0xC0010114
168 +#endif
169  #define MSR_IGNNE                  0xC0010115
170  #define MSR_SMM_CTL                0xC0010116
171 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
172  #define MSR_VM_HSAVE_PA            0xC0010117
173 -
174 +#endif
175  #define MSR_VM_CR_SVM_LOCK         0x0000000000000008ULL
176  #define MSR_VM_CR_SVME_DISABLE     0x0000000000000010ULL
177  
178 diff -Naur ./vmmon-only/Makefile.org ./vmmon-only/Makefile
179 --- ./vmmon-only/Makefile.org   2009-06-16 14:00:54.300080038 +0200
180 +++ ./vmmon-only/Makefile       2009-06-16 14:19:28.907079550 +0200
181 @@ -113,7 +113,7 @@
182  
183  vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
184         $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
185 -       $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
186 +       $(EXTRA_CFLAGS) -Iinclude -Iinclude2/asm/mach-default \
187         -DKBUILD_BASENAME=\"$(DRIVER)\" \
188         -Werror -S -o /dev/null -xc $(1) \
189         > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
190 diff -Naur ./vmnet-only/Makefile.org ./vmnet-only/Makefile
191 --- ./vmnet-only/Makefile.org   2009-06-16 14:20:46.281079270 +0200
192 +++ ./vmnet-only/Makefile       2009-06-16 14:21:26.569080038 +0200
193 @@ -113,7 +113,7 @@
194  
195  vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
196         $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
197 -       $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
198 +       $(EXTRA_CFLAGS) -Iinclude -Iinclude2/asm/mach-default \
199         -DKBUILD_BASENAME=\"$(DRIVER)\" \
200         -Werror -S -o /dev/null -xc $(1) \
201         > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
202 diff -Naur ./vmnet-only/netif.c.org ./vmnet-only/netif.c
203 --- ./vmnet-only/netif.c.org    2009-06-16 14:21:54.638079619 +0200
204 +++ ./vmnet-only/netif.c        2009-06-16 14:26:07.010079969 +0200
205 @@ -324,7 +324,11 @@
206        goto out;
207     }
208  
209 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
210     dev->priv = netIf;
211 +#else
212 +   dev->ml_priv = netIf;
213 +#endif
214     netIf->dev = dev;
215     
216     memcpy(dev->dev_addr, netIf->port.paddr, sizeof netIf->port.paddr);
217 @@ -566,7 +570,11 @@
218  VNetNetifStartXmit(struct sk_buff    *skb, // IN:
219                     struct net_device *dev) // IN:
220  {
221 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
222     VNetNetIF *netIf = (VNetNetIF*)dev->priv;
223 +#else
224 +   VNetNetIF *netIf = (VNetNetIF*)dev->ml_priv;
225 +#endif
226  
227     if(skb == NULL) {
228        return 0;
229 @@ -618,7 +626,11 @@
230  VNetNetifSetMAC(struct net_device *dev, // IN:
231                  void *p)                // IN:
232  {
233 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
234     VNetNetIF *netIf = (VNetNetIF*)dev->priv;
235 +#else
236 +   VNetNetIF *netIf = (VNetNetIF*)dev->ml_priv;
237 +#endif
238     struct sockaddr const *addr = p;
239     if (!VMX86_IS_STATIC_MAC(addr->sa_data)) {
240        return -EINVAL;
241 @@ -675,7 +687,11 @@
242  struct net_device_stats *
243  VNetNetifGetStats(struct net_device *dev) // IN:
244  {
245 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
246     VNetNetIF *netIf = (VNetNetIF*)dev->priv;
247 +#else
248 +   VNetNetIF *netIf = (VNetNetIF*)dev->ml_priv;
249 +#endif
250     return &(netIf->stats);
251  }
252  
253 diff -Naur ./vsock-only/Makefile.org ./vsock-only/Makefile
254 --- ./vsock-only/Makefile.org   2009-06-16 14:26:28.696079689 +0200
255 +++ ./vsock-only/Makefile       2009-06-16 14:27:11.486078991 +0200
256 @@ -113,7 +113,7 @@
257  
258  vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
259         $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
260 -       $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
261 +       $(EXTRA_CFLAGS) -Iinclude -Iinclude2/asm/mach-default \
262         -DKBUILD_BASENAME=\"$(DRIVER)\" \
263         -Werror -S -o /dev/null -xc $(1) \
264         > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
This page took 0.056682 seconds and 3 git commands to generate.