<node>0</node>
<block unit='KiB'>2048</block>
<requested unit='KiB'>1048576</requested>
+ <current unit='KiB'>524288</current>
</target>
</memory>
</devices>
The total size exposed to the guest. Must respect ``block`` granularity
and be smaller than or equal to ``size``.
+ ``current``
+ Active XML for ``virtio-mem`` model may contain ``current`` element that
+ reflects the current size of the corresponding virtio memory device. The
+ element is formatted into live XML and never parsed, i.e. it is
+ output-only element.
+
:anchor:`<a id="elementsIommu"/>`
IOMMU devices
<ref name="scaledInteger"/>
</element>
</optional>
+ <optional>
+ <element name="current">
+ <ref name="scaledInteger"/>
+ </element>
+ </optional>
<optional>
<element name="label">
<element name="size">
static void
virDomainMemoryTargetDefFormat(virBuffer *buf,
- virDomainMemoryDef *def)
+ virDomainMemoryDef *def,
+ unsigned int flags)
{
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
virBufferAsprintf(&childBuf, "<requested unit='KiB'>%llu</requested>\n",
def->requestedsize);
+ if (!(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE)) {
+ virBufferAsprintf(&childBuf, "<current unit='KiB'>%llu</current>\n",
+ def->currentsize);
+ }
}
virXMLFormatElement(buf, "target", NULL, &childBuf);
if (virDomainMemorySourceDefFormat(buf, def) < 0)
return -1;
- virDomainMemoryTargetDefFormat(buf, def);
+ virDomainMemoryTargetDefFormat(buf, def, flags);
virDomainDeviceInfoFormat(buf, &def->info, flags);
unsigned long long labelsize; /* kibibytes; valid only for NVDIMM */
unsigned long long blocksize; /* kibibytes; valid only for VIRTIO_MEM */
unsigned long long requestedsize; /* kibibytes; valid only for VIRTIO_MEM */
+ unsigned long long currentsize; /* kibibytes, valid for VIRTIO_MEM and
+ active domain only, only to report never
+ parse */
bool readonly; /* valid only for NVDIMM */
/* required for QEMU NVDIMM ppc64 support */