Now that the blockjob handling code deals with the status XML we don't
need to save it explicitly when starting blockjobs.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Note that this depends now on:
https://www.redhat.com/archives/libvir-list/2019-July/msg01088.html
Or fetch the whole updated series (due to a trivial rebase conflict) at:
git fetch
https://gitlab.com/pipo.sk/libvirt.git job-tracking-send-2
v2: - fixes qemuBlockJobEventProcessLegacy
src/qemu/qemu_blockjob.c | 5 +----
src/qemu/qemu_driver.c | 15 ---------------
2 files changed, 1 insertion(+), 19 deletions(-)
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index d9d22d8f61..4e832963e4 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -378,7 +378,6 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver,
qemuBlockJobDataPtr job,
int asyncJob)
{
- VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
virDomainDiskDefPtr disk = job->disk;
VIR_DEBUG("disk=%s, mirrorState=%s, type=%d, state=%d, newstate=%d",
@@ -405,6 +404,7 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver,
case VIR_DOMAIN_BLOCK_JOB_READY:
disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY;
+ qemuDomainSaveStatus(vm);
break;
case VIR_DOMAIN_BLOCK_JOB_FAILED:
@@ -422,9 +422,6 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver,
case VIR_DOMAIN_BLOCK_JOB_LAST:
break;
}
-
- 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);
}
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index af58dacbaa..d8a49d1fea 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17012,7 +17012,6 @@ qemuDomainBlockPullCommon(virQEMUDriverPtr driver,
unsigned int flags)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
- VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
VIR_AUTOFREE(char *) device = NULL;
virDomainDiskDefPtr disk;
virStorageSourcePtr baseSource = NULL;
@@ -17102,10 +17101,6 @@ qemuDomainBlockPullCommon(virQEMUDriverPtr driver,
qemuBlockJobStarted(job, vm);
- if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps)
< 0)
- VIR_WARN("Unable to save status on vm %s after state change",
- vm->def->name);
-
endjob:
qemuDomainObjEndJob(driver, vm);
@@ -17682,10 +17677,6 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
disk->mirrorJob = VIR_DOMAIN_BLOCK_JOB_TYPE_COPY;
qemuBlockJobStarted(job, vm);
- if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps)
< 0)
- VIR_WARN("Unable to save status on vm %s after state change",
- vm->def->name);
-
endjob:
if (need_unlink && virStorageFileUnlink(mirror) < 0)
VIR_WARN("%s", _("unable to remove just-created copy
target"));
@@ -17880,7 +17871,6 @@ qemuDomainBlockCommit(virDomainPtr dom,
unsigned int flags)
{
virQEMUDriverPtr driver = dom->conn->privateData;
- VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = NULL;
qemuDomainObjPrivatePtr priv;
virDomainObjPtr vm = NULL;
VIR_AUTOFREE(char *) device = NULL;
@@ -17909,7 +17899,6 @@ qemuDomainBlockCommit(virDomainPtr dom,
if (!(vm = qemuDomObjFromDomain(dom)))
goto cleanup;
priv = vm->privateData;
- cfg = virQEMUDriverGetConfig(driver);
if (virDomainBlockCommitEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
@@ -18072,10 +18061,6 @@ qemuDomainBlockCommit(virDomainPtr dom,
}
qemuBlockJobStarted(job, vm);
- 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);
-
endjob:
if (ret < 0 && clean_access) {
virErrorPtr orig_err = virSaveLastError();
--
2.21.0