diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index 70e98a708dab53a846e88675b97f8f26ecd68099..b1987e11fa730d3a72b10f62648ad02efd03c9e3 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -6,6 +6,16 @@
+
+
+
+
+
+
+
+
@@ -14,6 +24,9 @@
+
+
+
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5e37d96a54e8f19c88d2853534055468558bc470..868e8652253ffa595e14492455cada924aec0e24 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -506,6 +506,7 @@ void virDomainDefFree(virDomainDefPtr def)
VIR_FREE(def->name);
VIR_FREE(def->cpumask);
VIR_FREE(def->emulator);
+ VIR_FREE(def->description);
virSecurityLabelDefFree(def);
@@ -2534,6 +2535,9 @@ static virDomainDefPtr virDomainDefParseXML(virConnectPtr conn,
VIR_FREE(tmp);
}
+ /* Extract documentation if present */
+ def->description = virXPathString(conn, "string(./description[1])", ctxt);
+
/* Extract domain memory */
if (virXPathULong(conn, "string(./memory[1])", ctxt, &def->maxmem) < 0) {
virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
@@ -4197,6 +4201,10 @@ char *virDomainDefFormat(virConnectPtr conn,
virUUIDFormat(uuid, uuidstr);
virBufferVSprintf(&buf, " %s\n", uuidstr);
+ if (def->description)
+ virBufferEscapeString(&buf, " %s\n",
+ def->description);
+
virBufferVSprintf(&buf, " %lu\n", def->maxmem);
virBufferVSprintf(&buf, " %lu\n",
def->memory);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 7c918a7b03a6d47a593f51148484e5cbd6700938..4b3646ee8c122248bd5daec8f181a7b7c8e2272a 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -533,6 +533,7 @@ struct _virDomainDef {
int id;
unsigned char uuid[VIR_UUID_BUFLEN];
char *name;
+ char *description;
unsigned long memory;
unsigned long maxmem;