]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Introduce virDomainObjIsFailedPostcopy helper
authorJiri Denemark <jdenemar@redhat.com>
Tue, 10 May 2022 13:20:25 +0000 (15:20 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 7 Jun 2022 15:40:20 +0000 (17:40 +0200)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms

index ef38deddc5e642a39a61d90b6e2be29a9e360dbb..8cd8fb83a5bd4dec80d4d11049476d55b85d5b84 100644 (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)
 {
index e7e0f24443b5847795f5ae90e0fc5cb42f3f3a15..da85c6ecd4fc6503c0b4ba2e3cc0493b32973967 100644 (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);
 
index bfedd853268df79626b80e1518f5cf7f8c3d7a24..0c6dd4fa49504d2584dc26854e748d0deac061b6 100644 (file)
@@ -577,6 +577,7 @@ virDomainObjGetOneDef;
 virDomainObjGetOneDefState;
 virDomainObjGetPersistentDef;
 virDomainObjGetState;
+virDomainObjIsFailedPostcopy;
 virDomainObjNew;
 virDomainObjParseFile;
 virDomainObjParseNode;