*/
# define VIR_DOMAIN_SCHEDULER_CPU_SHARES "cpu_shares"
+/**
+ * VIR_DOMAIN_SCHEDULER_GLOBAL_PERIOD:
+ *
+ * Macro represents the enforcement period for a quota, in microseconds,
+ * for whole domain, when using the posix scheduler, as a ullong.
+ */
+# define VIR_DOMAIN_SCHEDULER_GLOBAL_PERIOD "global_period"
+
/**
* VIR_DOMAIN_SCHEDULER_VCPU_PERIOD:
*
*/
# define VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES "cputune.cpu_shares"
+/**
+ * VIR_DOMAIN_TUNABLE_CPU_GLOBAL_PERIOD:
+ *
+ * Macro represents the enforcement period for a quota, in microseconds,
+ * for whole domain, when using the posix scheduler, as VIR_TYPED_PARAM_ULLONG.
+ */
+# define VIR_DOMAIN_TUNABLE_CPU_GLOBAL_PERIOD "cputune.global_period"
+
/**
* VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD:
*
goto error;
}
+ if (virXPathULongLong("string(./cputune/global_period[1])", ctxt,
+ &def->cputune.global_period) < -1) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("can't parse cputune global period value"));
+ goto error;
+ }
+
+ if (def->cputune.global_period > 0 &&
+ (def->cputune.global_period < 1000 || def->cputune.global_period > 1000000)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Value of cputune global period must be in range "
+ "[1000, 1000000]"));
+ goto error;
+ }
+
if (virXPathULongLong("string(./cputune/emulator_period[1])", ctxt,
&def->cputune.emulator_period) < -1) {
virReportError(VIR_ERR_XML_ERROR, "%s",
if (def->cputune.quota)
virBufferAsprintf(&childrenBuf, "<quota>%lld</quota>\n",
def->cputune.quota);
+ if (def->cputune.global_period)
+ virBufferAsprintf(&childrenBuf, "<global_period>%llu</global_period>\n",
+ def->cputune.global_period);
if (def->cputune.emulator_period)
virBufferAsprintf(&childrenBuf, "<emulator_period>%llu"
bool sharesSpecified;
unsigned long long period;
long long quota;
+ unsigned long long global_period;
unsigned long long emulator_period;
long long emulator_quota;
virBitmapPtr emulatorpin;