mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
qemu: move virDomainNestedJobAllowed into hypervisor
Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
6260204c7f
commit
7537c4d0a5
@ -226,3 +226,11 @@ virDomainTrackJob(virDomainJob job)
|
||||
{
|
||||
return (VIR_DOMAIN_TRACK_JOBS & JOB_MASK(job)) != 0;
|
||||
}
|
||||
|
||||
bool
|
||||
virDomainNestedJobAllowed(virDomainJobObj *jobs, virDomainJob newJob)
|
||||
{
|
||||
return !jobs->asyncJob ||
|
||||
newJob == VIR_JOB_NONE ||
|
||||
(jobs->mask & JOB_MASK(newJob));
|
||||
}
|
||||
|
@ -222,3 +222,5 @@ void virDomainObjClearJob(virDomainJobObj *job);
|
||||
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virDomainJobObj, virDomainObjClearJob);
|
||||
|
||||
bool virDomainTrackJob(virDomainJob job);
|
||||
|
||||
bool virDomainNestedJobAllowed(virDomainJobObj *jobs, virDomainJob newJob);
|
||||
|
@ -1594,6 +1594,7 @@ virDomainJobDataInit;
|
||||
virDomainJobStatusToType;
|
||||
virDomainJobTypeFromString;
|
||||
virDomainJobTypeToString;
|
||||
virDomainNestedJobAllowed;
|
||||
virDomainObjClearJob;
|
||||
virDomainObjInitJob;
|
||||
virDomainObjPreserveJob;
|
||||
|
@ -697,14 +697,6 @@ qemuDomainObjReleaseAsyncJob(virDomainObj *obj)
|
||||
priv->job.asyncOwner = 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
qemuDomainNestedJobAllowed(virDomainJobObj *jobs, virDomainJob newJob)
|
||||
{
|
||||
return !jobs->asyncJob ||
|
||||
newJob == VIR_JOB_NONE ||
|
||||
(jobs->mask & JOB_MASK(newJob)) != 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
qemuDomainObjCanSetJob(virDomainJobObj *job,
|
||||
virDomainJob newJob,
|
||||
@ -787,7 +779,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver,
|
||||
goto error;
|
||||
}
|
||||
|
||||
while (!nested && !qemuDomainNestedJobAllowed(&priv->job, job)) {
|
||||
while (!nested && !virDomainNestedJobAllowed(&priv->job, job)) {
|
||||
if (nowait)
|
||||
goto cleanup;
|
||||
|
||||
@ -807,7 +799,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver,
|
||||
|
||||
/* No job is active but a new async job could have been started while obj
|
||||
* was unlocked, so we need to recheck it. */
|
||||
if (!nested && !qemuDomainNestedJobAllowed(&priv->job, job))
|
||||
if (!nested && !virDomainNestedJobAllowed(&priv->job, job))
|
||||
goto retry;
|
||||
|
||||
if (obj->removing) {
|
||||
@ -896,7 +888,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver,
|
||||
duration / 1000, agentDuration / 1000, asyncDuration / 1000);
|
||||
|
||||
if (job) {
|
||||
if (nested || qemuDomainNestedJobAllowed(&priv->job, job))
|
||||
if (nested || virDomainNestedJobAllowed(&priv->job, job))
|
||||
blocker = priv->job.ownerAPI;
|
||||
else
|
||||
blocker = priv->job.asyncOwnerAPI;
|
||||
|
Loading…
Reference in New Issue
Block a user