Add the ability to set and retrieve additional state information for the domain. Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx> Signed-off-by: Bjoern Walk <bwalk@xxxxxxxxxxxxx> --- src/conf/domain_conf.c | 15 ++++++++++++++- src/conf/domain_conf.h | 6 ++++++ src/libvirt_private.syms | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 805da60d..211a77a2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -28766,7 +28766,10 @@ virDomainObjGetState(virDomainObjPtr dom, int *reason) void -virDomainObjSetState(virDomainObjPtr dom, virDomainState state, int reason) +virDomainObjSetStateFull(virDomainObjPtr dom, + virDomainState state, + int reason, + const char *info) { int last; @@ -28806,6 +28809,16 @@ virDomainObjSetState(virDomainObjPtr dom, virDomainState state, int reason) dom->state.reason = reason; else dom->state.reason = 0; + + VIR_FREE(dom->state.info); + ignore_value(VIR_STRDUP(dom->state.info, info)); +} + + +void +virDomainObjSetState(virDomainObjPtr dom, virDomainState state, int reason) +{ + virDomainObjSetStateFull(dom, state, reason, NULL); } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index d4fd676f..b4be3c49 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3320,6 +3320,12 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk, void *opaque); void +virDomainObjSetStateFull(virDomainObjPtr obj, + virDomainState state, + int reason, + const char *info) + ATTRIBUTE_NONNULL(1); +void virDomainObjSetState(virDomainObjPtr obj, virDomainState state, int reason) ATTRIBUTE_NONNULL(1); virDomainState diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index e688981c..a1b28ccd 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -484,6 +484,7 @@ virDomainObjRemoveTransientDef; virDomainObjSetDefTransient; virDomainObjSetMetadata; virDomainObjSetState; +virDomainObjSetStateFull; virDomainObjTaint; virDomainObjUpdateModificationImpact; virDomainObjWait; -- 2.17.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list