[pve-devel] [PATCH] remove openvz fairscheduler code from fairsched patch

Alexandre Derumier aderumier at odiso.com
Tue May 26 14:11:05 CEST 2015


Only keep -id option , needed for vnc

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 debian/patches/fairsched.diff | 116 +-----------------------------------------
 1 file changed, 2 insertions(+), 114 deletions(-)

diff --git a/debian/patches/fairsched.diff b/debian/patches/fairsched.diff
index e01023f..a8d786b 100644
--- a/debian/patches/fairsched.diff
+++ b/debian/patches/fairsched.diff
@@ -2,16 +2,13 @@ Index: new/qemu-options.hx
 ===================================================================
 --- new.orig/qemu-options.hx	2014-11-20 06:45:06.000000000 +0100
 +++ new/qemu-options.hx	2014-11-20 06:50:44.000000000 +0100
-@@ -386,6 +386,12 @@
+@@ -386,6 +386,9 @@
  @table @option
  ETEXI
  
 +DEF("id", HAS_ARG, QEMU_OPTION_id,
 +    "-id n	     set the faisched ID\n", QEMU_ARCH_ALL)
 +
-+DEF("cpuunits",  HAS_ARG, QEMU_OPTION_cpuunits,
-+    "-cpuuinits n    set fairsched cpu units\n", QEMU_ARCH_ALL)
-+
  DEF("fda", HAS_ARG, QEMU_OPTION_fda,
      "-fda/-fdb file  use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
  DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
@@ -19,15 +16,6 @@ Index: new/vl.c
 ===================================================================
 --- new.orig/vl.c	2014-11-20 06:45:06.000000000 +0100
 +++ new/vl.c	2014-11-20 06:50:44.000000000 +0100
-@@ -101,6 +101,8 @@
- #endif
- #include "sysemu/qtest.h"
- 
-+#include "vzsyscalls.h"
-+
- #include "disas/disas.h"
- 
- 
 @@ -154,6 +156,7 @@
  CharDriverState *sclp_hds[MAX_SCLP_CONSOLES];
  int win2k_install_hack = 0;
@@ -46,7 +34,7 @@ Index: new/vl.c
      int snapshot, linux_boot;
      const char *initrd_filename;
      const char *kernel_filename, *kernel_cmdline;
-@@ -3560,6 +3566,21 @@
+@@ -3560,6 +3566,14 @@
                      exit(1);
                  }
                  break;
@@ -58,106 +46,6 @@ Index: new/vl.c
 +		    exit(1);
 +		}
 +                break;
-+            case QEMU_OPTION_cpuunits:
-+                cpuunits = atoi(optarg);
-+		if (cpuunits < 8 || cpuunits > 500000) {
-+		    fprintf(stderr, "Invalid value for cpuunits\n");
-+                    exit(1);
-+                }
-+                break;
  	    case QEMU_OPTION_vnc:
  #ifdef CONFIG_VNC
                  display_remote++;
-@@ -3844,6 +3865,40 @@
-                           OBJECT_CLASS(machine_class))));
-     object_property_add_child(object_get_root(), "machine",
-                               OBJECT(current_machine), &error_abort);
-+
-+    if (cpuunits && !fairsched_id) {
-+        fprintf(stderr, "cpuunits specified without -id");
-+        exit(1);
-+    }
-+
-+    if (fairsched_id && cpuunits) {
-+	int ret;
-+	int weight = cpuunits ? 500000/cpuunits : 500;
-+	pid_t cpid = getpid();
-+
-+	ret = syscall(__NR_fairsched_rmnod, fairsched_id);
-+	if (ret == -EBUSY) {
-+	    fprintf (stderr, "unable to create fairsched node - still in use\n");
-+	    exit(1);
-+	}
-+
-+	ret = syscall(__NR_fairsched_mknod, 0, weight, fairsched_id);
-+	if (ret != fairsched_id) {
-+	    fprintf (stderr, "unable to create fairsched node\n");
-+	    exit(1);
-+	}
-+
-+	ret = syscall(__NR_fairsched_mvpr, cpid, fairsched_id);
-+	if (ret != 0) {
-+	    fprintf (stderr, "unable to move procces to fairsched group");
-+	    exit (1);
-+	}
-+
-+	/* note: we can never remove ourself from the group, so the empty group
-+	   will exist after we finish
-+	*/
-+    }
-+
-     cpu_exec_init_all();
- 
-     if (machine_class->hw_version) {
-Index: new/vzsyscalls.h
-===================================================================
---- /dev/null	1970-01-01 00:00:00.000000000 +0000
-+++ new/vzsyscalls.h	2014-11-20 06:50:44.000000000 +0100
-@@ -0,0 +1,47 @@
-+/*
-+ *  Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
-+ *
-+ *  This program is free software; you can redistribute it and/or modify
-+ *  it under the terms of the GNU General Public License as published by
-+ *  the Free Software Foundation; either version 2 of the License, or
-+ *  (at your option) any later version.
-+ *
-+ *  This program is distributed in the hope that it will be useful,
-+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ *  GNU General Public License for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License
-+ *  along with this program; if not, write to the Free Software
-+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-+ */
-+#ifndef _VZSYSCALLS_H_
-+#define _VZSYSCALLS_H_
-+
-+#include <sys/syscall.h>
-+
-+#ifdef __x86_64__
-+#define __NR_fairsched_vcpus	499
-+#define __NR_setluid		501
-+#define __NR_setublimit		502
-+#define __NR_fairsched_mknod    504
-+#define __NR_fairsched_rmnod    505
-+#define __NR_fairsched_chwt	506
-+#define __NR_fairsched_mvpr     507
-+#define __NR_fairsched_rate	508
-+#define __NR_ioprio_set		251
-+#elif defined(__i386__)
-+#define __NR_fairsched_mknod    500
-+#define __NR_fairsched_rmnod    501
-+#define __NR_fairsched_chwt	502
-+#define __NR_fairsched_mvpr     503
-+#define __NR_fairsched_rate	504
-+#define __NR_fairsched_vcpus	505
-+#define __NR_setluid		511
-+#define __NR_setublimit		512
-+#define __NR_ioprio_set		289
-+#else
-+#error "no syscall for this arch"
-+#endif
-+
-+#endif
-- 
2.1.4



More information about the pve-devel mailing list