*/
# define VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW "compression_overflow"
+/**
+ * VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE:
+ *
+ * virDomainGetJobStats field: current percentage guest CPUs are throttled
+ * to when auto-convergence decided migration was not converging, as
+ * VIR_TYPED_PARAM_INT.
+ */
+# define VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE "auto_converge_throttle"
/**
goto error;
}
+ if (stats->cpu_throttle_percentage &&
+ virTypedParamsAddInt(&par, &npar, &maxpar,
+ VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE,
+ stats->cpu_throttle_percentage) < 0)
+ goto error;
+
*type = jobInfo->type;
*params = par;
*nparams = npar;
stats->xbzrle_overflow);
}
+ virBufferAsprintf(buf, "<%1$s>%2$d</%1$s>\n",
+ VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE,
+ stats->cpu_throttle_percentage);
+
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</statistics>\n");
}
virXPathULongLong("string(./" VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW "[1])",
ctxt, &stats->xbzrle_overflow);
+ virXPathInt("string(./" VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE "[1])",
+ ctxt, &stats->cpu_throttle_percentage);
cleanup:
ctxt->node = save_ctxt;
return jobInfo;
unsigned long long xbzrle_pages;
unsigned long long xbzrle_cache_miss;
unsigned long long xbzrle_overflow;
+
+ int cpu_throttle_percentage;
};
int qemuMonitorGetMigrationStats(qemuMonitorPtr mon,
&stats->setup_time) == 0)
stats->setup_time_set = true;
+ ignore_value(virJSONValueObjectGetNumberInt(ret, "cpu-throttle-percentage",
+ &stats->cpu_throttle_percentage));
+
switch ((qemuMonitorMigrationStatus) stats->status) {
case QEMU_MONITOR_MIGRATION_STATUS_INACTIVE:
case QEMU_MONITOR_MIGRATION_STATUS_SETUP:
int nparams = 0;
unsigned long long value;
unsigned int flags = 0;
+ int ivalue;
int rc;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
vshPrint(ctl, "%-17s %-13llu\n", _("Compression overflows:"), value);
}
+ if ((rc = virTypedParamsGetInt(params, nparams,
+ VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE,
+ &ivalue)) < 0) {
+ goto save_error;
+ } else if (rc) {
+ vshPrint(ctl, "%-17s %-13d\n", _("Auto converge throttle:"), ivalue);
+ }
+
ret = true;
cleanup: