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 fb3ea0f..a1ea6a5 100644
--- a/include/libvirt/libvirt-domain.h
+++ b/include/libvirt/libvirt-domain.h
@@ -2329,6 +2329,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
@@ -2342,6 +2343,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 e2f5a0b..8f6d9f2 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -11785,12 +11785,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