From b1b037fa5b4444243d72eadf0e31aa0f3e9389cb Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Tue, 28 Feb 2023 16:53:29 +0100 Subject: Introduce VIR_DOMAIN_PAUSED_API_ERROR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some APIs (migration, save/restore, snapshot, ...) require a domain to be suspended temporarily. In case resuming the domain fails, the domain will be unexpectedly left paused when the API finishes. This situation is reported via VIR_DOMAIN_EVENT_SUSPENDED event with VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR detail. But we do not have a corresponding reason for VIR_DOMAIN_PAUSED state and the reason would remain set to the value used when the domain was paused. So the state reason would suggest the operation is still running. This patch changes the state reason to a new VIR_DOMAIN_PAUSED_API_ERROR to make it clear the API that paused the domain already finished, but failed to resume the domain. Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- include/libvirt/libvirt-domain.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 53cab6bd4c..3ebb2c6642 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -148,6 +148,7 @@ typedef enum { VIR_DOMAIN_PAUSED_STARTING_UP = 11, /* the domain is being started (Since: 1.2.14) */ VIR_DOMAIN_PAUSED_POSTCOPY = 12, /* paused for post-copy migration (Since: 1.3.3) */ VIR_DOMAIN_PAUSED_POSTCOPY_FAILED = 13, /* paused after failed post-copy (Since: 1.3.3) */ + VIR_DOMAIN_PAUSED_API_ERROR = 14, /* Some APIs (e.g., migration, snapshot) internally need to suspend a domain. This paused state reason is used when resume operation at the end of such API fails. (Since: 9.2.0) */ # ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_PAUSED_LAST /* (Since: 0.9.10) */ -- cgit v1.2.1