mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
conf: Introduce virDomainObjIsPostcopy 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:
parent
efe95fb878
commit
83ccd3a3d1
@ -29249,6 +29249,28 @@ virDomainObjIsFailedPostcopy(virDomainObj *dom)
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
virDomainObjIsPostcopy(virDomainObj *dom,
|
||||
virDomainJobOperation op)
|
||||
{
|
||||
if (op != VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN &&
|
||||
op != VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT)
|
||||
return false;
|
||||
|
||||
if (op == VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN) {
|
||||
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 ||
|
||||
dom->state.reason == VIR_DOMAIN_RUNNING_POSTCOPY_FAILED));
|
||||
}
|
||||
|
||||
return dom->state.state == VIR_DOMAIN_PAUSED &&
|
||||
(dom->state.reason == VIR_DOMAIN_PAUSED_POSTCOPY ||
|
||||
dom->state.reason == VIR_DOMAIN_PAUSED_POSTCOPY_FAILED);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
virDomainObjSetState(virDomainObj *dom, virDomainState state, int reason)
|
||||
{
|
||||
|
@ -3889,6 +3889,10 @@ virDomainObjGetState(virDomainObj *obj, int *reason)
|
||||
bool
|
||||
virDomainObjIsFailedPostcopy(virDomainObj *obj)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
bool
|
||||
virDomainObjIsPostcopy(virDomainObj *dom,
|
||||
virDomainJobOperation op)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
||||
virSecurityLabelDef *
|
||||
virDomainDefGetSecurityLabelDef(const virDomainDef *def, const char *model);
|
||||
|
@ -578,6 +578,7 @@ virDomainObjGetOneDefState;
|
||||
virDomainObjGetPersistentDef;
|
||||
virDomainObjGetState;
|
||||
virDomainObjIsFailedPostcopy;
|
||||
virDomainObjIsPostcopy;
|
||||
virDomainObjNew;
|
||||
virDomainObjParseFile;
|
||||
virDomainObjParseNode;
|
||||
|
Loading…
Reference in New Issue
Block a user