Introduce VIR_DOMAIN_PAUSED_API_ERROR

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 <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jiri Denemark
2023-02-28 16:53:29 +01:00
parent 6414046e9c
commit b1b037fa5b
6 changed files with 22 additions and 0 deletions

View File

@@ -192,6 +192,7 @@ VIR_ENUM_IMPL(virshDomainPausedReason,
N_("starting up"),
N_("post-copy"),
N_("post-copy failed"),
N_("api error"),
);
VIR_ENUM_DECL(virshDomainShutdownReason);