diff -urN source-OLD/vmblock-only/linux/control.c source-NEW/vmblock-only/linux/control.c
--- source-OLD/vmblock-only/linux/control.c	2008-10-28 22:47:20.000000000 -0700
+++ source-NEW/vmblock-only/linux/control.c	2009-05-07 12:25:33.000000000 -0700
@@ -46,7 +46,9 @@
 
 static struct proc_dir_entry *controlProcDirEntry;
 struct file_operations ControlFileOps = {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
    .owner   = THIS_MODULE,
+#endif
    .write   = ControlFileOpWrite,
    .release = ControlFileOpRelease,
 };
@@ -156,7 +158,9 @@
       return -EINVAL;
    }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
    controlProcDirEntry->owner = THIS_MODULE;
+#endif
 
    /* Create /proc/fs/vmblock/mountPoint */
    controlProcMountpoint = proc_mkdir(VMBLOCK_CONTROL_MOUNTPOINT,
@@ -168,7 +172,9 @@
       return -EINVAL;
    }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
    controlProcMountpoint->owner = THIS_MODULE;
+#endif
 
    /* Create /proc/fs/vmblock/dev */
    controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
diff -urN source-OLD/vmblock-only/Makefile source-NEW/vmblock-only/Makefile
--- source-OLD/vmblock-only/Makefile	2008-10-28 22:47:20.000000000 -0700
+++ source-NEW/vmblock-only/Makefile	2009-03-26 19:29:30.000000000 -0700
@@ -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 -urN source-OLD/vmci-only/Makefile source-NEW/vmci-only/Makefile
--- source-OLD/vmci-only/Makefile	2008-10-28 22:47:21.000000000 -0700
+++ source-NEW/vmci-only/Makefile	2009-03-26 19:30:11.000000000 -0700
@@ -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 -urN source-OLD/vmmon-only/include/x86svm.h source-NEW/vmmon-only/include/x86svm.h
--- source-OLD/vmmon-only/include/x86svm.h	2008-10-28 22:47:17.000000000 -0700
+++ source-NEW/vmmon-only/include/x86svm.h	2009-05-07 12:25:06.000000000 -0700
@@ -47,10 +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 -urN source-OLD/vmmon-only/linux/driver.c source-NEW/vmmon-only/linux/driver.c
--- source-OLD/vmmon-only/linux/driver.c	2008-10-28 22:47:18.000000000 -0700
+++ source-NEW/vmmon-only/linux/driver.c	2009-03-31 11:20:24.000000000 -0700
@@ -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, &current->mm->flags);
diff -urN source-OLD/vmmon-only/linux/hostif.c source-NEW/vmmon-only/linux/hostif.c
--- source-OLD/vmmon-only/linux/hostif.c	2008-10-28 22:47:17.000000000 -0700
+++ source-NEW/vmmon-only/linux/hostif.c	2009-03-31 11:47:10.000000000 -0700
@@ -3423,6 +3423,88 @@
 }
 
 
+/* 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
+}
+
+
 /*
  *----------------------------------------------------------------------
  *
@@ -3455,7 +3537,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) {
@@ -3579,19 +3661,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 -urN source-OLD/vmmon-only/Makefile source-NEW/vmmon-only/Makefile
--- source-OLD/vmmon-only/Makefile	2008-10-28 22:47:18.000000000 -0700
+++ source-NEW/vmmon-only/Makefile	2009-03-30 16:24:00.000000000 -0700
@@ -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 -urN source-OLD/vmnet-only/Makefile source-NEW/vmnet-only/Makefile
--- source-OLD/vmnet-only/Makefile	2008-10-28 22:47:19.000000000 -0700
+++ source-NEW/vmnet-only/Makefile	2009-03-26 19:31:13.000000000 -0700
@@ -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 -urN source-OLD/vmnet-only/netif.c source-NEW/vmnet-only/netif.c
--- source-OLD/vmnet-only/netif.c	2008-10-28 22:47:18.000000000 -0700
+++ source-NEW/vmnet-only/netif.c	2009-03-31 11:37:08.000000000 -0700
@@ -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 -urN source-OLD/vsock-only/Makefile source-NEW/vsock-only/Makefile
--- source-OLD/vsock-only/Makefile	2008-10-28 22:47:22.000000000 -0700
+++ source-NEW/vsock-only/Makefile	2009-03-26 19:32:12.000000000 -0700
@@ -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)
