mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
conf: record deprecation messages against the domain
These messages will be stored in the live status XML. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
bebaafd6b4
commit
842900dc1e
@ -1788,6 +1788,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
|
static void
|
||||||
virDomainGraphicsAuthDefClear(virDomainGraphicsAuthDefPtr def)
|
virDomainGraphicsAuthDefClear(virDomainGraphicsAuthDefPtr def)
|
||||||
{
|
{
|
||||||
@ -21258,7 +21267,8 @@ virDomainObjParseXML(xmlDocPtr xml,
|
|||||||
int reason = 0;
|
int reason = 0;
|
||||||
void *parseOpaque = NULL;
|
void *parseOpaque = NULL;
|
||||||
g_autofree char *tmp = 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)))
|
if (!(obj = virDomainObjNew(xmlopt)))
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -21305,10 +21315,10 @@ virDomainObjParseXML(xmlDocPtr xml,
|
|||||||
}
|
}
|
||||||
obj->pid = (pid_t)val;
|
obj->pid = (pid_t)val;
|
||||||
|
|
||||||
if ((n = virXPathNodeSet("./taint", ctxt, &nodes)) < 0)
|
if ((n = virXPathNodeSet("./taint", ctxt, &taintNodes)) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
char *str = virXMLPropString(nodes[i], "flag");
|
char *str = virXMLPropString(taintNodes[i], "flag");
|
||||||
if (str) {
|
if (str) {
|
||||||
int flag = virDomainTaintTypeFromString(str);
|
int flag = virDomainTaintTypeFromString(str);
|
||||||
if (flag < 0) {
|
if (flag < 0) {
|
||||||
@ -21322,6 +21332,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 &&
|
if (xmlopt->privateData.parse &&
|
||||||
xmlopt->privateData.parse(ctxt, obj, &xmlopt->config) < 0)
|
xmlopt->privateData.parse(ctxt, obj, &xmlopt->config) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
@ -29166,6 +29183,11 @@ virDomainObjFormat(virDomainObjPtr obj,
|
|||||||
virDomainTaintTypeToString(i));
|
virDomainTaintTypeToString(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < obj->ndeprecations; i++) {
|
||||||
|
virBufferEscapeString(&buf, "<deprecation>%s</deprecation>\n",
|
||||||
|
obj->deprecations[i]);
|
||||||
|
}
|
||||||
|
|
||||||
if (xmlopt->privateData.format &&
|
if (xmlopt->privateData.format &&
|
||||||
xmlopt->privateData.format(&buf, obj) < 0)
|
xmlopt->privateData.format(&buf, obj) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -2804,6 +2804,8 @@ struct _virDomainObj {
|
|||||||
void (*privateDataFreeFunc)(void *);
|
void (*privateDataFreeFunc)(void *);
|
||||||
|
|
||||||
int taint;
|
int taint;
|
||||||
|
size_t ndeprecations;
|
||||||
|
char **deprecations;
|
||||||
|
|
||||||
unsigned long long original_memlock; /* Original RLIMIT_MEMLOCK, zero if no
|
unsigned long long original_memlock; /* Original RLIMIT_MEMLOCK, zero if no
|
||||||
* restore will be required later */
|
* restore will be required later */
|
||||||
@ -3061,6 +3063,8 @@ void virDomainObjEndAPI(virDomainObjPtr *vm);
|
|||||||
|
|
||||||
bool virDomainObjTaint(virDomainObjPtr obj,
|
bool virDomainObjTaint(virDomainObjPtr obj,
|
||||||
virDomainTaintFlags taint);
|
virDomainTaintFlags taint);
|
||||||
|
void virDomainObjDeprecation(virDomainObjPtr obj,
|
||||||
|
const char *msg);
|
||||||
|
|
||||||
void virDomainObjBroadcast(virDomainObjPtr vm);
|
void virDomainObjBroadcast(virDomainObjPtr vm);
|
||||||
int virDomainObjWait(virDomainObjPtr vm);
|
int virDomainObjWait(virDomainObjPtr vm);
|
||||||
|
@ -548,6 +548,7 @@ virDomainObjAssignDef;
|
|||||||
virDomainObjBroadcast;
|
virDomainObjBroadcast;
|
||||||
virDomainObjCheckActive;
|
virDomainObjCheckActive;
|
||||||
virDomainObjCopyPersistentDef;
|
virDomainObjCopyPersistentDef;
|
||||||
|
virDomainObjDeprecation;
|
||||||
virDomainObjEndAPI;
|
virDomainObjEndAPI;
|
||||||
virDomainObjFormat;
|
virDomainObjFormat;
|
||||||
virDomainObjGetDefs;
|
virDomainObjGetDefs;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user