The helper checks whether VM is active including the internal qemu
state. This helper will become useful in situations when an async job
is in use as VIR_JOB_DESTROY can run along async jobs thus both checks
are necessary.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
}
+/**
+ * qemuDomainObjIsActive:
+ * @vm: domain object
+ *
+ * Return whether @vm is active. Take qemu-driver specifics into account.
+ */
+bool
+qemuDomainObjIsActive(virDomainObj *vm)
+{
+ qemuDomainObjPrivate *priv = vm->privateData;
+
+ if (priv->beingDestroyed)
+ return false;
+
+ return virDomainObjIsActive(vm);
+}
+
+
/**
* virDomainRefreshStatsSchema:
* @driver: qemu driver data
int
qemuDomainObjWait(virDomainObj *vm);
+bool
+qemuDomainObjIsActive(virDomainObj *vm);
int
qemuDomainRefreshStatsSchema(virDomainObj *dom);