packages: VMware-server/VMware-server-linux-2.6.30.patch (NEW) - new
adamg
adamg at pld-linux.org
Fri Jul 3 15:07:30 CEST 2009
Author: adamg Date: Fri Jul 3 13:07:30 2009 GMT
Module: packages Tag: HEAD
---- Log message:
- new
---- Files affected:
packages/VMware-server:
VMware-server-linux-2.6.30.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/VMware-server/VMware-server-linux-2.6.30.patch
diff -u /dev/null packages/VMware-server/VMware-server-linux-2.6.30.patch:1.1
--- /dev/null Fri Jul 3 15:07:30 2009
+++ packages/VMware-server/VMware-server-linux-2.6.30.patch Fri Jul 3 15:07:24 2009
@@ -0,0 +1,264 @@
+diff -Naur ./vmci-only/Makefile.org ./vmci-only/Makefile
+--- ./vmci-only/Makefile.org 2009-06-16 14:05:27.466108603 +0200
++++ ./vmci-only/Makefile 2009-06-16 14:06:46.661080248 +0200
+@@ -113,7 +113,7 @@
+
+ vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
+ $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
+- $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
++ $(EXTRA_CFLAGS) -I$(HEADER_DIR) -Iinclude2/asm/mach-default \
+ -DKBUILD_BASENAME=\"$(DRIVER)\" \
+ -Werror -S -o /dev/null -xc $(1) \
+ > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
+diff -Naur ./vmmon-only/linux/driver.c.org ./vmmon-only/linux/driver.c
+--- ./vmmon-only/linux/driver.c.org 2009-06-16 14:00:30.039078851 +0200
++++ ./vmmon-only/linux/driver.c 2009-06-16 14:09:41.715105671 +0200
+@@ -1984,10 +1984,17 @@
+ }
+
+ case IOCTL_VMX86_ALLOW_CORE_DUMP:
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+ if (current->euid == current->uid &&
+ current->fsuid == current->uid &&
+ current->egid == current->gid &&
+ current->fsgid == current->gid) {
++#else
++ if (current_euid() == current_uid() &&
++ current_fsuid() == current_uid() &&
++ current_egid() == current_gid() &&
++ current_fsgid() == current_gid()) {
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) || defined(MMF_DUMPABLE)
+ /* Dump core, readable by user. */
+ set_bit(MMF_DUMPABLE, ¤t->mm->flags);
+diff -Naur ./vmmon-only/linux/hostif.c.org ./vmmon-only/linux/hostif.c
+--- ./vmmon-only/linux/hostif.c.org 2009-06-16 14:00:44.806106788 +0200
++++ ./vmmon-only/linux/hostif.c 2009-06-16 14:18:30.693079131 +0200
+@@ -3422,6 +3422,86 @@
+ }
+ return -ENOIOCTLCMD;
+ }
++/* krellan: Linux 2.6.29 compatibility functions for capabilities */
++/* Errors are logged but otherwise ignored */
++
++void compat_cap_raise(int cap)
++{
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
++ cap_raise(current->cap_effective, cap);
++#else
++ struct cred *new_cred;
++
++ new_cred = prepare_creds();
++ if (new_cred != NULL)
++ {
++ cap_raise(new_cred->cap_effective, cap);
++ commit_creds(new_cred);
++ }
++ else
++ {
++ Log("compat_cap_raise(%d) prepare_creds(): Out of memory\n", cap);
++ }
++#endif
++}
++
++void compat_cap_lower(int cap)
++{
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
++ cap_lower(current->cap_effective, cap);
++#else
++ struct cred *new_cred;
++
++ new_cred = prepare_creds();
++ if (new_cred != NULL)
++ {
++ cap_lower(new_cred->cap_effective, cap);
++ commit_creds(new_cred);
++ }
++ else
++ {
++ Log("compat_cap_lower(%d) prepare_creds(): Out of memory\n", cap);
++ }
++#endif
++}
++
++int compat_cap_raised(int cap)
++{
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
++ return cap_raised(current->cap_effective, cap);
++#else
++ return cap_raised(current_cap(), cap);
++#endif
++}
++
++int compat_get_fsuid(void)
++{
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
++ return current->fsuid;
++#else
++ return current_fsuid();
++#endif
++}
++
++void compat_set_fsuid(int fsuid)
++{
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
++ current->fsuid = fsuid;
++#else
++ struct cred *new_cred;
++
++ new_cred = prepare_creds();
++ if (new_cred != NULL)
++ {
++ new_cred->fsuid = fsuid;
++ commit_creds(new_cred);
++ }
++ else
++ {
++ Log("compat_set_fsuid(%d) prepare_creds(): Out of memory\n", fsuid);
++ }
++#endif
++}
+
+
+ /*
+@@ -3456,7 +3536,7 @@
+ oldFS = get_fs();
+ set_fs(KERNEL_DS);
+ compat_allow_signal(SIGKILL);
+- cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
++ compat_cap_raise(CAP_SYS_RESOURCE);
+ compat_set_user_nice(current, linuxState.fastClockPriority);
+
+ while (linuxState.fastClockRate > HZ + HZ/16) {
+@@ -3580,19 +3660,19 @@
+ Bool cap;
+ long pid;
+
+- fsuid = current->fsuid;
+- current->fsuid = 0;
++ fsuid = compat_get_fsuid();
++ compat_set_fsuid(0);
+ filp = filp_open("/dev/rtc", O_RDONLY, 0);
+- current->fsuid = fsuid;
++ compat_set_fsuid(fsuid);
+ if (IS_ERR(filp)) {
+ Warning("/dev/rtc open failed: %d\n", (int)(VA)filp);
+ return -(int)(VA)filp;
+ }
+- cap = cap_raised(current->cap_effective, CAP_SYS_RESOURCE);
+- cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
++ cap = compat_cap_raised(CAP_SYS_RESOURCE);
++ compat_cap_raise(CAP_SYS_RESOURCE);
+ res = HostIFDoIoctl(filp, RTC_PIE_ON, 0);
+ if (!cap) {
+- cap_lower(current->cap_effective, CAP_SYS_RESOURCE);
++ compat_cap_lower(CAP_SYS_RESOURCE);
+ }
+ if (res < 0) {
+ Warning("/dev/rtc enable interrupt failed: %d\n", res);
+diff -Naur ./vmmon-only/include/x86svm.h.org ./vmmon-only/include/x86svm.h
+--- ./vmmon-only/include/x86svm.h.org 2009-06-16 14:00:11.623087791 +0200
++++ ./vmmon-only/include/x86svm.h 2009-06-16 14:04:32.344079689 +0200
+@@ -47,11 +47,14 @@
+ #endif
+
+ /* SVM related MSRs */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+ #define MSR_VM_CR 0xC0010114
++#endif
+ #define MSR_IGNNE 0xC0010115
+ #define MSR_SMM_CTL 0xC0010116
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+ #define MSR_VM_HSAVE_PA 0xC0010117
+-
++#endif
+ #define MSR_VM_CR_SVM_LOCK 0x0000000000000008ULL
+ #define MSR_VM_CR_SVME_DISABLE 0x0000000000000010ULL
+
+diff -Naur ./vmmon-only/Makefile.org ./vmmon-only/Makefile
+--- ./vmmon-only/Makefile.org 2009-06-16 14:00:54.300080038 +0200
++++ ./vmmon-only/Makefile 2009-06-16 14:19:28.907079550 +0200
+@@ -113,7 +113,7 @@
+
+ vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
+ $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
+- $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
++ $(EXTRA_CFLAGS) -I$(HEADER_DIR) -Iinclude2/asm/mach-default \
+ -DKBUILD_BASENAME=\"$(DRIVER)\" \
+ -Werror -S -o /dev/null -xc $(1) \
+ > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
+diff -Naur ./vmnet-only/Makefile.org ./vmnet-only/Makefile
+--- ./vmnet-only/Makefile.org 2009-06-16 14:20:46.281079270 +0200
++++ ./vmnet-only/Makefile 2009-06-16 14:21:26.569080038 +0200
+@@ -113,7 +113,7 @@
+
+ vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
+ $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
+- $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
++ $(EXTRA_CFLAGS) -I$(HEADER_DIR) -Iinclude2/asm/mach-default \
+ -DKBUILD_BASENAME=\"$(DRIVER)\" \
+ -Werror -S -o /dev/null -xc $(1) \
+ > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
+diff -Naur ./vmnet-only/netif.c.org ./vmnet-only/netif.c
+--- ./vmnet-only/netif.c.org 2009-06-16 14:21:54.638079619 +0200
++++ ./vmnet-only/netif.c 2009-06-16 14:26:07.010079969 +0200
+@@ -324,7 +324,11 @@
+ goto out;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+ dev->priv = netIf;
++#else
++ dev->ml_priv = netIf;
++#endif
+ netIf->dev = dev;
+
+ memcpy(dev->dev_addr, netIf->port.paddr, sizeof netIf->port.paddr);
+@@ -566,7 +570,11 @@
+ VNetNetifStartXmit(struct sk_buff *skb, // IN:
+ struct net_device *dev) // IN:
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+ VNetNetIF *netIf = (VNetNetIF*)dev->priv;
++#else
++ VNetNetIF *netIf = (VNetNetIF*)dev->ml_priv;
++#endif
+
+ if(skb == NULL) {
+ return 0;
+@@ -618,7 +626,11 @@
+ VNetNetifSetMAC(struct net_device *dev, // IN:
+ void *p) // IN:
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+ VNetNetIF *netIf = (VNetNetIF*)dev->priv;
++#else
++ VNetNetIF *netIf = (VNetNetIF*)dev->ml_priv;
++#endif
+ struct sockaddr const *addr = p;
+ if (!VMX86_IS_STATIC_MAC(addr->sa_data)) {
+ return -EINVAL;
+@@ -675,7 +687,11 @@
+ struct net_device_stats *
+ VNetNetifGetStats(struct net_device *dev) // IN:
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+ VNetNetIF *netIf = (VNetNetIF*)dev->priv;
++#else
++ VNetNetIF *netIf = (VNetNetIF*)dev->ml_priv;
++#endif
+ return &(netIf->stats);
+ }
+
+diff -Naur ./vsock-only/Makefile.org ./vsock-only/Makefile
+--- ./vsock-only/Makefile.org 2009-06-16 14:26:28.696079689 +0200
++++ ./vsock-only/Makefile 2009-06-16 14:27:11.486078991 +0200
+@@ -113,7 +113,7 @@
+
+ vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
+ $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \
+- $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \
++ $(EXTRA_CFLAGS) -I$(HEADER_DIR) -Iinclude2/asm/mach-default \
+ -DKBUILD_BASENAME=\"$(DRIVER)\" \
+ -Werror -S -o /dev/null -xc $(1) \
+ > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
================================================================
More information about the pld-cvs-commit
mailing list