It makes sense to move this to other hypervisor-based functions
into the private job callback structure to make begin job
general.
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/hypervisor/domain_job.h | 2 ++
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domainjob.c | 4 ++--
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/hypervisor/domain_job.h b/src/hypervisor/domain_job.h
index 30893dabc3..838cfd16e3 100644
--- a/src/hypervisor/domain_job.h
+++ b/src/hypervisor/domain_job.h
@@ -196,6 +196,7 @@ typedef int (*virDomainObjPrivateJobFormat)(virBuffer *,
typedef int (*virDomainObjPrivateJobParse)(xmlXPathContextPtr,
virDomainJobObj *,
virDomainObj *);
+typedef void (*virDomainObjPrivateSaveStatus)(virDomainObj *obj);
struct _virDomainObjPrivateJobCallbacks {
virDomainObjPrivateJobAlloc allocJobPrivate;
@@ -203,6 +204,7 @@ struct _virDomainObjPrivateJobCallbacks {
virDomainObjPrivateJobReset resetJobPrivate;
virDomainObjPrivateJobFormat formatJobPrivate;
virDomainObjPrivateJobParse parseJobPrivate;
+ virDomainObjPrivateSaveStatus saveStatusPrivate;
};
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index bc5961a09f..94b50420fe 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -366,6 +366,7 @@ static virDomainObjPrivateJobCallbacks qemuPrivateJobCallbacks = {
.resetJobPrivate = qemuJobResetPrivate,
.formatJobPrivate = qemuDomainFormatJobPrivate,
.parseJobPrivate = qemuDomainParseJobPrivate,
+ .saveStatusPrivate = qemuDomainSaveStatus,
};
/**
diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c
index d682f7be38..11f30de136 100644
--- a/src/qemu/qemu_domainjob.c
+++ b/src/qemu/qemu_domainjob.c
@@ -844,8 +844,8 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver,
priv->job.agentStarted = now;
}
- if (virDomainTrackJob(job))
- qemuDomainSaveStatus(obj);
+ if (virDomainTrackJob(job) && priv->job.cb)
+ priv->job.cb->saveStatusPrivate(obj);
return 0;
--
2.37.1