default read-write access is given (currently only works for
QEMU/KVM driver).
</dd>
+
+ <dt><code>space_hard_limit</code></dt>
+ <dd>
+ Maximum space available to this guest's filesystem.
+ <span class="since">Since 0.9.13</span>
+ </dd>
+
+ <dt><code>space_soft_limit</code></dt>
+ <dd>
+ Maximum space available to this guest's filesystem. The container is
+ permitted to exceed its soft limits for a grace period of time. Afterwards the
+ hard limit is enforced.
+ <span class="since">Since 0.9.13</span>
+ </dd>
</dl>
<h4><a name="elementsAddress">Device Addresses</a></h4>
*/
static virDomainFSDefPtr
virDomainFSDefParseXML(xmlNodePtr node,
+ xmlXPathContextPtr ctxt,
unsigned int flags) {
virDomainFSDefPtr def;
- xmlNodePtr cur;
+ xmlNodePtr cur, save_node = ctxt->node;
char *type = NULL;
char *fsdriver = NULL;
char *source = NULL;
char *accessmode = NULL;
char *wrpolicy = NULL;
+ ctxt->node = node;
+
if (VIR_ALLOC(def) < 0) {
virReportOOMError();
return NULL;
def->accessmode = VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH;
}
+ if (virDomainParseScaledValue("./space_hard_limit[1]", ctxt,
+ &def->space_hard_limit, 1,
+ ULONG_LONG_MAX,
+ false) < 0)
+ goto error;
+
+ if (virDomainParseScaledValue("./space_soft_limit[1]", ctxt,
+ &def->space_soft_limit, 1,
+ ULONG_LONG_MAX,
+ false) < 0)
+ goto error;
+
cur = node->children;
while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) {
goto error;
cleanup:
+ ctxt->node = save_node;
VIR_FREE(type);
VIR_FREE(fsdriver);
VIR_FREE(target);
goto error;
} else if (xmlStrEqual(node->name, BAD_CAST "filesystem")) {
dev->type = VIR_DOMAIN_DEVICE_FS;
- if (!(dev->data.fs = virDomainFSDefParseXML(node, flags)))
+ if (!(dev->data.fs = virDomainFSDefParseXML(node, ctxt, flags)))
goto error;
} else if (xmlStrEqual(node->name, BAD_CAST "interface")) {
dev->type = VIR_DOMAIN_DEVICE_NET;
if (n && VIR_ALLOC_N(def->fss, n) < 0)
goto no_memory;
for (i = 0 ; i < n ; i++) {
- virDomainFSDefPtr fs = virDomainFSDefParseXML(nodes[i],
+ virDomainFSDefPtr fs = virDomainFSDefParseXML(nodes[i], ctxt,
flags);
if (!fs)
goto error;
if (virDomainDeviceInfoFormat(buf, &def->info, flags) < 0)
return -1;
+
+ if (def->space_hard_limit)
+ virBufferAsprintf(buf, " <space_hard_limit unit='bytes'>"
+ "%llu</space_hard_limit>\n", def->space_hard_limit);
+ if (def->space_soft_limit) {
+ virBufferAsprintf(buf, " <space_soft_limit unit='bytes'>"
+ "%llu</space_soft_limit>\n", def->space_soft_limit);
+ }
virBufferAddLit(buf, " </filesystem>\n");
return 0;