mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
qemu: beginJob: move saveStatus into private job callbacks
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@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
4217d08475
commit
6ba0ead714
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
@ -366,6 +366,7 @@ static virDomainObjPrivateJobCallbacks qemuPrivateJobCallbacks = {
|
||||
.resetJobPrivate = qemuJobResetPrivate,
|
||||
.formatJobPrivate = qemuDomainFormatJobPrivate,
|
||||
.parseJobPrivate = qemuDomainParseJobPrivate,
|
||||
.saveStatusPrivate = qemuDomainSaveStatus,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user