mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
qemu: move virDomainObjCanSetJob() into hypervisor
Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
7537c4d0a5
commit
54f48e033e
@ -234,3 +234,14 @@ virDomainNestedJobAllowed(virDomainJobObj *jobs, virDomainJob newJob)
|
||||
newJob == VIR_JOB_NONE ||
|
||||
(jobs->mask & JOB_MASK(newJob));
|
||||
}
|
||||
|
||||
bool
|
||||
virDomainObjCanSetJob(virDomainJobObj *job,
|
||||
virDomainJob newJob,
|
||||
virDomainAgentJob newAgentJob)
|
||||
{
|
||||
return ((newJob == VIR_JOB_NONE ||
|
||||
job->active == VIR_JOB_NONE) &&
|
||||
(newAgentJob == VIR_AGENT_JOB_NONE ||
|
||||
job->agentActive == VIR_AGENT_JOB_NONE));
|
||||
}
|
||||
|
@ -224,3 +224,7 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virDomainJobObj, virDomainObjClearJob);
|
||||
bool virDomainTrackJob(virDomainJob job);
|
||||
|
||||
bool virDomainNestedJobAllowed(virDomainJobObj *jobs, virDomainJob newJob);
|
||||
|
||||
bool virDomainObjCanSetJob(virDomainJobObj *job,
|
||||
virDomainJob newJob,
|
||||
virDomainAgentJob newAgentJob);
|
||||
|
@ -1595,6 +1595,7 @@ virDomainJobStatusToType;
|
||||
virDomainJobTypeFromString;
|
||||
virDomainJobTypeToString;
|
||||
virDomainNestedJobAllowed;
|
||||
virDomainObjCanSetJob;
|
||||
virDomainObjClearJob;
|
||||
virDomainObjInitJob;
|
||||
virDomainObjPreserveJob;
|
||||
|
@ -697,17 +697,6 @@ qemuDomainObjReleaseAsyncJob(virDomainObj *obj)
|
||||
priv->job.asyncOwner = 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
qemuDomainObjCanSetJob(virDomainJobObj *job,
|
||||
virDomainJob newJob,
|
||||
virDomainAgentJob newAgentJob)
|
||||
{
|
||||
return ((newJob == VIR_JOB_NONE ||
|
||||
job->active == VIR_JOB_NONE) &&
|
||||
(newAgentJob == VIR_AGENT_JOB_NONE ||
|
||||
job->agentActive == VIR_AGENT_JOB_NONE));
|
||||
}
|
||||
|
||||
/* Give up waiting for mutex after 30 seconds */
|
||||
#define QEMU_JOB_WAIT_TIME (1000ull * 30)
|
||||
|
||||
@ -788,7 +777,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver,
|
||||
goto error;
|
||||
}
|
||||
|
||||
while (!qemuDomainObjCanSetJob(&priv->job, job, agentJob)) {
|
||||
while (!virDomainObjCanSetJob(&priv->job, job, agentJob)) {
|
||||
if (nowait)
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user