mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
qemu: blockjob: Update new job state earlier in qemuBlockJobEventProcessLegacy
The legacy job handler does not look at the old job state so we can update it earlier. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
b6316435e4
commit
9dd12d4ecf
@ -350,9 +350,12 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver,
|
||||
|
||||
qemuBlockJobEmitEvents(driver, vm, disk, job->type, job->newstate);
|
||||
|
||||
job->state = job->newstate;
|
||||
job->newstate = -1;
|
||||
|
||||
/* If we completed a block pull or commit, then update the XML
|
||||
* to match. */
|
||||
switch ((virConnectDomainEventBlockJobStatus) job->newstate) {
|
||||
switch ((virConnectDomainEventBlockJobStatus) job->state) {
|
||||
case VIR_DOMAIN_BLOCK_JOB_COMPLETED:
|
||||
qemuBlockJobEventProcessLegacyCompleted(driver, vm, job, asyncJob);
|
||||
break;
|
||||
@ -377,9 +380,6 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver,
|
||||
break;
|
||||
}
|
||||
|
||||
job->state = job->newstate;
|
||||
job->newstate = -1;
|
||||
|
||||
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
|
||||
VIR_WARN("Unable to save status on vm %s after block job", vm->def->name);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user