This should be emitted whenever a domain is renamed.
Signed-off-by: Tomas Meszaros <exo(a)tty.sk>
---
examples/object-events/event-test.c | 4 ++++
include/libvirt/libvirt-domain.h | 2 ++
tools/virsh-domain.c | 6 ++++--
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/examples/object-events/event-test.c b/examples/object-events/event-test.c
index 4f17273..dcae981 100644
--- a/examples/object-events/event-test.c
+++ b/examples/object-events/event-test.c
@@ -108,10 +108,14 @@ static const char *eventDetailToString(int event, int detail) {
ret = "Added";
else if (detail == VIR_DOMAIN_EVENT_DEFINED_UPDATED)
ret = "Updated";
+ else if (detail == VIR_DOMAIN_EVENT_DEFINED_RENAMED)
+ ret = "Renamed";
break;
case VIR_DOMAIN_EVENT_UNDEFINED:
if (detail == VIR_DOMAIN_EVENT_UNDEFINED_REMOVED)
ret = "Removed";
+ else if (detail == VIR_DOMAIN_EVENT_UNDEFINED_RENAMED)
+ ret = "Renamed";
break;
case VIR_DOMAIN_EVENT_STARTED:
switch ((virDomainEventStartedDetailType) detail) {
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
index 82f86bb..77304f0 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -2322,6 +2322,7 @@ typedef enum {
typedef enum {
VIR_DOMAIN_EVENT_DEFINED_ADDED = 0, /* Newly created config file */
VIR_DOMAIN_EVENT_DEFINED_UPDATED = 1, /* Changed config file */
+ VIR_DOMAIN_EVENT_DEFINED_RENAMED = 2, /* Domain was renamed */
# ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_EVENT_DEFINED_LAST
@@ -2335,6 +2336,7 @@ typedef enum {
*/
typedef enum {
VIR_DOMAIN_EVENT_UNDEFINED_REMOVED = 0, /* Deleted the config file */
+ VIR_DOMAIN_EVENT_UNDEFINED_RENAMED = 1, /* Domain was renamed */
# ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_EVENT_UNDEFINED_LAST
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 128cfac..2325360 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -11763,12 +11763,14 @@ VIR_ENUM_DECL(vshDomainEventDefined)
VIR_ENUM_IMPL(vshDomainEventDefined,
VIR_DOMAIN_EVENT_DEFINED_LAST,
N_("Added"),
- N_("Updated"))
+ N_("Updated"),
+ N_("Renamed"))
VIR_ENUM_DECL(vshDomainEventUndefined)
VIR_ENUM_IMPL(vshDomainEventUndefined,
VIR_DOMAIN_EVENT_UNDEFINED_LAST,
- N_("Removed"))
+ N_("Removed"),
+ N_("Renamed"))
VIR_ENUM_DECL(vshDomainEventStarted)
VIR_ENUM_IMPL(vshDomainEventStarted,
--
2.1.0