<li>'xen' — default with Xen</li>
</ul>
</dd>
+ <dt><code>autodeflate</code></dt>
+ <dd>
+ <p>
+ The optional <code>autodeflate</code> attribute allows to
+ enable/disable (values "on"/"off", respectively) the ability of the
+ QEMU virtio memory balloon to release some memory at the last moment
+ before a guest's process get killed by Out of Memory killer.
+ <span class="since">Since 1.3.1, QEMU and KVM only</span>
+ </p>
+ </dd>
<dt><code>period</code></dt>
<dd>
<p>
unsigned int flags)
{
char *model;
+ char *deflate;
virDomainMemballoonDefPtr def;
xmlNodePtr save = ctxt->node;
unsigned int period = 0;
goto error;
}
+ if ((deflate = virXMLPropString(node, "autodeflate")) &&
+ (def->autodeflate = virTristateSwitchTypeFromString(deflate)) <= 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("invalid autodeflate attribute value '%s'"), deflate);
+ goto error;
+ }
+
ctxt->node = node;
if (virXPathUInt("string(./stats/@period)", ctxt, &period) < -1) {
virReportError(VIR_ERR_XML_ERROR, "%s",
cleanup:
VIR_FREE(model);
+ VIR_FREE(deflate);
ctxt->node = save;
return def;
return false;
}
+ if (src->autodeflate != dst->autodeflate) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Target balloon autodeflate attribute value "
+ "'%s' does not match source '%s'"),
+ virTristateSwitchTypeToString(dst->autodeflate),
+ virTristateSwitchTypeToString(src->autodeflate));
+ return false;
+ }
+
if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info))
return false;
}
virBufferAsprintf(buf, "<memballoon model='%s'", model);
+
+ if (def->autodeflate != VIR_TRISTATE_SWITCH_ABSENT)
+ virBufferAsprintf(buf, " autodeflate='%s'",
+ virTristateSwitchTypeToString(def->autodeflate));
+
virBufferAdjustIndent(&childrenBuf, indent + 2);
if (def->period)