These messages will be stored in the live status XML.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/conf/domain_conf.c | 28 +++++++++++++++++++++++++---
src/conf/domain_conf.h | 4 ++++
src/libvirt_private.syms | 1 +
3 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5346c40a81..86c4639bda 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1774,6 +1774,15 @@ bool virDomainObjTaint(virDomainObjPtr obj,
}
+void virDomainObjDeprecation(virDomainObjPtr obj,
+ const char *msg)
+{
+ obj->deprecations = g_renew(char *, obj->deprecations,
+ obj->ndeprecations + 1);
+ obj->deprecations[obj->ndeprecations++] = g_strdup(msg);
+}
+
+
static void
virDomainGraphicsAuthDefClear(virDomainGraphicsAuthDefPtr def)
{
@@ -21205,7 +21214,8 @@ virDomainObjParseXML(xmlDocPtr xml,
int reason = 0;
void *parseOpaque = NULL;
g_autofree char *tmp = NULL;
- g_autofree xmlNodePtr *nodes = NULL;
+ g_autofree xmlNodePtr *taintNodes = NULL;
+ g_autofree xmlNodePtr *depNodes = NULL;
if (!(obj = virDomainObjNew(xmlopt)))
return NULL;
@@ -21252,10 +21262,10 @@ virDomainObjParseXML(xmlDocPtr xml,
}
obj->pid = (pid_t)val;
- if ((n = virXPathNodeSet("./taint", ctxt, &nodes)) < 0)
+ if ((n = virXPathNodeSet("./taint", ctxt, &taintNodes)) < 0)
goto error;
for (i = 0; i < n; i++) {
- char *str = virXMLPropString(nodes[i], "flag");
+ char *str = virXMLPropString(taintNodes[i], "flag");
if (str) {
int flag = virDomainTaintTypeFromString(str);
if (flag < 0) {
@@ -21269,6 +21279,13 @@ virDomainObjParseXML(xmlDocPtr xml,
}
}
+ if ((n = virXPathNodeSet("./deprecation", ctxt, &depNodes)) < 0)
+ goto error;
+ for (i = 0; i < n; i++) {
+ g_autofree char *str = virXMLNodeContentString(depNodes[i]);
+ virDomainObjDeprecation(obj, str);
+ }
+
if (xmlopt->privateData.parse &&
xmlopt->privateData.parse(ctxt, obj, &xmlopt->config) < 0)
goto error;
@@ -29073,6 +29090,11 @@ virDomainObjFormat(virDomainObjPtr obj,
virDomainTaintTypeToString(i));
}
+ for (i = 0; i < obj->ndeprecations; i++) {
+ virBufferEscapeString(&buf,
"<deprecation>%s</deprecation>\n",
+ obj->deprecations[i]);
+ }
+
if (xmlopt->privateData.format &&
xmlopt->privateData.format(&buf, obj) < 0)
return NULL;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 55abbec0fe..9ae1bd3eeb 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2799,6 +2799,8 @@ struct _virDomainObj {
void (*privateDataFreeFunc)(void *);
int taint;
+ size_t ndeprecations;
+ char **deprecations;
unsigned long long original_memlock; /* Original RLIMIT_MEMLOCK, zero if no
* restore will be required later */
@@ -3056,6 +3058,8 @@ void virDomainObjEndAPI(virDomainObjPtr *vm);
bool virDomainObjTaint(virDomainObjPtr obj,
virDomainTaintFlags taint);
+void virDomainObjDeprecation(virDomainObjPtr obj,
+ const char *msg);
void virDomainObjBroadcast(virDomainObjPtr vm);
int virDomainObjWait(virDomainObjPtr vm);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index c325040b60..7a73943ba0 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -547,6 +547,7 @@ virDomainObjAssignDef;
virDomainObjBroadcast;
virDomainObjCheckActive;
virDomainObjCopyPersistentDef;
+virDomainObjDeprecation;
virDomainObjEndAPI;
virDomainObjFormat;
virDomainObjGetDefs;
--
2.29.2