conf: Introduce virDomainObjIsFailedPostcopy helper

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Jiri Denemark 2022-05-10 15:20:25 +02:00
parent 6ca0ff90ac
commit efe95fb878
3 changed files with 15 additions and 0 deletions

View File

@ -29239,6 +29239,16 @@ virDomainObjGetState(virDomainObj *dom, int *reason)
}
bool
virDomainObjIsFailedPostcopy(virDomainObj *dom)
{
return ((dom->state.state == VIR_DOMAIN_PAUSED &&
dom->state.reason == VIR_DOMAIN_PAUSED_POSTCOPY_FAILED) ||
(dom->state.state == VIR_DOMAIN_RUNNING &&
dom->state.reason == VIR_DOMAIN_RUNNING_POSTCOPY_FAILED));
}
void
virDomainObjSetState(virDomainObj *dom, virDomainState state, int reason)
{

View File

@ -3886,6 +3886,10 @@ virDomainState
virDomainObjGetState(virDomainObj *obj, int *reason)
ATTRIBUTE_NONNULL(1);
bool
virDomainObjIsFailedPostcopy(virDomainObj *obj)
ATTRIBUTE_NONNULL(1);
virSecurityLabelDef *
virDomainDefGetSecurityLabelDef(const virDomainDef *def, const char *model);

View File

@ -577,6 +577,7 @@ virDomainObjGetOneDef;
virDomainObjGetOneDefState;
virDomainObjGetPersistentDef;
virDomainObjGetState;
virDomainObjIsFailedPostcopy;
virDomainObjNew;
virDomainObjParseFile;
virDomainObjParseNode;