mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +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
|
void
|
||||||
virDomainObjSetState(virDomainObj *dom, virDomainState state, int reason)
|
virDomainObjSetState(virDomainObj *dom, virDomainState state, int reason)
|
||||||
{
|
{
|
||||||
|
@ -3889,6 +3889,10 @@ virDomainObjGetState(virDomainObj *obj, int *reason)
|
|||||||
bool
|
bool
|
||||||
virDomainObjIsFailedPostcopy(virDomainObj *obj)
|
virDomainObjIsFailedPostcopy(virDomainObj *obj)
|
||||||
ATTRIBUTE_NONNULL(1);
|
ATTRIBUTE_NONNULL(1);
|
||||||
|
bool
|
||||||
|
virDomainObjIsPostcopy(virDomainObj *dom,
|
||||||
|
virDomainJobOperation op)
|
||||||
|
ATTRIBUTE_NONNULL(1);
|
||||||
|
|
||||||
virSecurityLabelDef *
|
virSecurityLabelDef *
|
||||||
virDomainDefGetSecurityLabelDef(const virDomainDef *def, const char *model);
|
virDomainDefGetSecurityLabelDef(const virDomainDef *def, const char *model);
|
||||||
|
@ -578,6 +578,7 @@ virDomainObjGetOneDefState;
|
|||||||
virDomainObjGetPersistentDef;
|
virDomainObjGetPersistentDef;
|
||||||
virDomainObjGetState;
|
virDomainObjGetState;
|
||||||
virDomainObjIsFailedPostcopy;
|
virDomainObjIsFailedPostcopy;
|
||||||
|
virDomainObjIsPostcopy;
|
||||||
virDomainObjNew;
|
virDomainObjNew;
|
||||||
virDomainObjParseFile;
|
virDomainObjParseFile;
|
||||||
virDomainObjParseNode;
|
virDomainObjParseNode;
|
||||||
|
Loading…
Reference in New Issue
Block a user