Deadline scheduler, or SCHED_DEADLINE, is a new realtime scheduler
added to Linux 3.14. In order to support it as a possible value in
vcpusched/iothreadsched, we have to add it to scheduler related
structures.
---
src/conf/domain_conf.c | 1 +
src/conf/domain_conf.h | 3 +++
src/util/virprocess.c | 13 ++++++++++++-
src/util/virprocess.h | 1 +
4 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6e008e2..2dd5e6f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -23132,6 +23132,7 @@ virDomainFormatSchedDef(virDomainDefPtr def,
case VIR_PROC_POLICY_NONE:
case VIR_PROC_POLICY_BATCH:
case VIR_PROC_POLICY_IDLE:
+ case VIR_PROC_POLICY_DEADLINE:
case VIR_PROC_POLICY_LAST:
currentMap = schedMap;
break;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 541b600..67b9e3e 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1840,6 +1840,9 @@ typedef virDomainThreadSchedParam *virDomainThreadSchedParamPtr;
struct _virDomainThreadSchedParam {
virProcessSchedPolicy policy;
int priority;
+ unsigned long long runtime;
+ unsigned long long deadline;
+ unsigned long long period;
};
typedef struct _virDomainTimerCatchupDef virDomainTimerCatchupDef;
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 3cacc89..9b4a555 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -34,6 +34,9 @@
#endif
#if HAVE_SCHED_SETSCHEDULER
# include <sched.h>
+# ifdef __linux__
+# include <linux/sched.h>
+# endif
#endif
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || HAVE_BSD_CPU_AFFINITY
@@ -111,7 +114,8 @@ VIR_ENUM_IMPL(virProcessSchedPolicy, VIR_PROC_POLICY_LAST,
"batch",
"idle",
"fifo",
- "rr");
+ "rr",
+ "deadline");
/**
* virProcessTranslateStatus:
@@ -1212,6 +1216,13 @@ virProcessSchedTranslatePolicy(virProcessSchedPolicy policy)
case VIR_PROC_POLICY_RR:
return SCHED_RR;
+ case VIR_PROC_POLICY_DEADLINE:
+# ifdef SCHED_DEADLINE
+ return SCHED_DEADLINE;
+# else
+ return -1;
+# endif
+
case VIR_PROC_POLICY_LAST:
/* nada */
break;
diff --git a/src/util/virprocess.h b/src/util/virprocess.h
index 04e9802..1eac3e6 100644
--- a/src/util/virprocess.h
+++ b/src/util/virprocess.h
@@ -34,6 +34,7 @@ typedef enum {
VIR_PROC_POLICY_IDLE,
VIR_PROC_POLICY_FIFO,
VIR_PROC_POLICY_RR,
+ VIR_PROC_POLICY_DEADLINE,
VIR_PROC_POLICY_LAST
} virProcessSchedPolicy;
--
2.8.1