mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
qemu: Always save status XML in qemuDomainBlockJobAbort
For copy and active commit jobs we record the state of the mirror so that we can recover. The status XML was not saved in case of qemuDomainBlockPivot due to an oversight. Save the XML always when invoking qemuDomainBlockJobAbort even if the job is not currently tracking any state. This will change later and also this is not a particularly hot code path. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
94fce25546
commit
ef8a87a09d
@ -17313,7 +17313,6 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
|
||||
char *device = NULL;
|
||||
virDomainDiskDefPtr disk = NULL;
|
||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||
bool save = false;
|
||||
bool pivot = !!(flags & VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT);
|
||||
bool async = !!(flags & VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC);
|
||||
qemuBlockJobDataPtr job = NULL;
|
||||
@ -17365,10 +17364,8 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
|
||||
if ((ret = qemuDomainBlockPivot(driver, vm, device, disk)) < 0)
|
||||
goto endjob;
|
||||
} else {
|
||||
if (disk->mirror) {
|
||||
if (disk->mirror)
|
||||
disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_ABORT;
|
||||
save = true;
|
||||
}
|
||||
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
ret = qemuMonitorBlockJobCancel(qemuDomainGetMonitor(vm), device);
|
||||
@ -17384,10 +17381,6 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
|
||||
}
|
||||
}
|
||||
|
||||
/* If we have made changes to XML due to a copy job, make a best
|
||||
* effort to save it now. But we can ignore failure, since there
|
||||
* will be further changes when the event marks completion. */
|
||||
if (save)
|
||||
ignore_value(virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps));
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user