qemu: Rename qemuDomainObjRestoreJob as qemuDomainObjPreserveJob

It is used for saving job out of domain object. Just like
virErrorPreserveLast is used for errors. Let's make the naming
consistent as Restore would suggest different semantics.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Jiri Denemark 2022-05-10 15:20:25 +02:00
parent 7c1840fa37
commit d6d1c4980d
3 changed files with 15 additions and 5 deletions

View File

@ -214,8 +214,18 @@ qemuDomainObjResetAsyncJob(qemuDomainJobObj *job)
job->cb->resetJobPrivate(job->privateData);
}
/**
* qemuDomainObjPreserveJob
* @param obj domain with a job that needs to be preserved
* @param job structure where to store job details from @obj
*
* Saves the current job details from @obj to @job and resets the job in @obj.
*
* Returns 0 on success, -1 on failure.
*/
int
qemuDomainObjRestoreJob(virDomainObj *obj,
qemuDomainObjPreserveJob(virDomainObj *obj,
qemuDomainJobObj *job)
{
qemuDomainObjPrivate *priv = obj->privateData;

View File

@ -158,7 +158,7 @@ void qemuDomainObjSetJobPhase(virDomainObj *obj,
int phase);
void qemuDomainObjSetAsyncJobMask(virDomainObj *obj,
unsigned long long allowedJobs);
int qemuDomainObjRestoreJob(virDomainObj *obj,
int qemuDomainObjPreserveJob(virDomainObj *obj,
qemuDomainJobObj *job);
void qemuDomainObjDiscardAsyncJob(virDomainObj *obj);
void qemuDomainObjReleaseAsyncJob(virDomainObj *obj);

View File

@ -8714,7 +8714,7 @@ qemuProcessReconnect(void *opaque)
cfg = virQEMUDriverGetConfig(driver);
priv = obj->privateData;
qemuDomainObjRestoreJob(obj, &oldjob);
qemuDomainObjPreserveJob(obj, &oldjob);
if (oldjob.asyncJob == VIR_ASYNC_JOB_MIGRATION_IN)
stopFlags |= VIR_QEMU_PROCESS_STOP_MIGRATED;
if (oldjob.asyncJob == VIR_ASYNC_JOB_BACKUP && priv->backup)