[libvirt] [PATCH] Remove VIR_DOMAIN_SHUTDOWN_CRASHED from public API

From: "Daniel P. Berrange" <berrange@redhat.com> The VIR_DOMAIN_SHUTDOWN_CRASHED state constant does not appear to be used in the QEMU code anyway. It also doesn't make much (any) sense, since the 'shutdown' state is a transient state between 'running' and 'shutoff' which is only used by the Xen driver. It was added in commit 14e7e0ae8db9843aea80245a3d9e6cf5f2ef720d which post-dates v1.1.0, so is safe to remove before 1.1.1 Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- include/libvirt/libvirt.h.in | 1 - src/conf/domain_conf.c | 3 +-- tools/virsh-domain-monitor.c | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index c0eb25b..4eae7bf 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -191,7 +191,6 @@ typedef enum { typedef enum { VIR_DOMAIN_SHUTDOWN_UNKNOWN = 0, /* the reason is unknown */ VIR_DOMAIN_SHUTDOWN_USER = 1, /* shutting down on user request */ - VIR_DOMAIN_SHUTDOWN_CRASHED = 2, /* domain crashed */ #ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_SHUTDOWN_LAST diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a86be8c..783df96 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -667,8 +667,7 @@ VIR_ENUM_IMPL(virDomainPausedReason, VIR_DOMAIN_PAUSED_LAST, VIR_ENUM_IMPL(virDomainShutdownReason, VIR_DOMAIN_SHUTDOWN_LAST, "unknown", - "user", - "crashed") + "user") VIR_ENUM_IMPL(virDomainShutoffReason, VIR_DOMAIN_SHUTOFF_LAST, "unknown", diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 773f96d..98fe7fe 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -240,8 +240,6 @@ vshDomainStateReasonToString(int state, int reason) switch ((virDomainShutdownReason) reason) { case VIR_DOMAIN_SHUTDOWN_USER: return N_("user"); - case VIR_DOMAIN_SHUTDOWN_CRASHED: - return N_("crashed"); case VIR_DOMAIN_SHUTDOWN_UNKNOWN: case VIR_DOMAIN_SHUTDOWN_LAST: ; -- 1.8.1.4

On 07/29/2013 10:48 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
The VIR_DOMAIN_SHUTDOWN_CRASHED state constant does not appear to be used in the QEMU code anyway. It also doesn't make much (any) sense, since the 'shutdown' state is a transient state between 'running' and 'shutoff' which is only used by the Xen driver.
It was added in commit 14e7e0ae8db9843aea80245a3d9e6cf5f2ef720d which post-dates v1.1.0, so is safe to remove before 1.1.1
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> ---
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Mon, Jul 29, 2013 at 17:48:15 +0100, Daniel Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
The VIR_DOMAIN_SHUTDOWN_CRASHED state constant does not appear to be used in the QEMU code anyway. It also doesn't make much (any) sense, since the 'shutdown' state is a transient state between 'running' and 'shutoff' which is only used by the Xen driver.
It was added in commit 14e7e0ae8db9843aea80245a3d9e6cf5f2ef720d which post-dates v1.1.0, so is safe to remove before 1.1.1
The "shutdown" state is actually also used by the QEMU driver with the same semantics as in the Xen driver. However, if a domain crashed than it's shutoff and not somewhere between running and shutoff. ACK Jirka

On Mon, 2013-07-29 at 17:48 +0100, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
The VIR_DOMAIN_SHUTDOWN_CRASHED state constant does not appear to be used in the QEMU code anyway. It also doesn't make much (any) sense, since the 'shutdown' state is a transient state between 'running' and 'shutoff' which is only used by the Xen driver.
It was added in commit 14e7e0ae8db9843aea80245a3d9e6cf5f2ef720d which post-dates v1.1.0, so is safe to remove before 1.1.1
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Tested-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com> --- include/libvirt/libvirt.h.in | 1 - src/conf/domain_conf.c | 3 +-- tools/virsh-domain-monitor.c | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index c0eb25b..4eae7bf 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -191,7 +191,6 @@ typedef enum { typedef enum { VIR_DOMAIN_SHUTDOWN_UNKNOWN = 0, /* the reason is unknown */ VIR_DOMAIN_SHUTDOWN_USER = 1, /* shutting down on user request */ - VIR_DOMAIN_SHUTDOWN_CRASHED = 2, /* domain crashed */
#ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_SHUTDOWN_LAST diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a86be8c..783df96 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -667,8 +667,7 @@ VIR_ENUM_IMPL(virDomainPausedReason, VIR_DOMAIN_PAUSED_LAST,
VIR_ENUM_IMPL(virDomainShutdownReason, VIR_DOMAIN_SHUTDOWN_LAST, "unknown", - "user", - "crashed") + "user")
VIR_ENUM_IMPL(virDomainShutoffReason, VIR_DOMAIN_SHUTOFF_LAST, "unknown", diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 773f96d..98fe7fe 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -240,8 +240,6 @@ vshDomainStateReasonToString(int state, int reason) switch ((virDomainShutdownReason) reason) { case VIR_DOMAIN_SHUTDOWN_USER: return N_("user"); - case VIR_DOMAIN_SHUTDOWN_CRASHED: - return N_("crashed"); case VIR_DOMAIN_SHUTDOWN_UNKNOWN: case VIR_DOMAIN_SHUTDOWN_LAST: ;
participants (4)
-
chenfan
-
Daniel P. Berrange
-
Eric Blake
-
Jiri Denemark