mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: domain: Introduce qemuDomainObjIsActive helper
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>
This commit is contained in:
parent
d9935a5c4f
commit
9eb33b7f03
@ -12397,6 +12397,24 @@ qemuDomainObjWait(virDomainObj *vm)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
@ -1113,6 +1113,8 @@ qemuDomainRemoveLogs(virQEMUDriver *driver,
|
||||
|
||||
int
|
||||
qemuDomainObjWait(virDomainObj *vm);
|
||||
bool
|
||||
qemuDomainObjIsActive(virDomainObj *vm);
|
||||
|
||||
int
|
||||
qemuDomainRefreshStatsSchema(virDomainObj *dom);
|
||||
|
Loading…
x
Reference in New Issue
Block a user