The field is used to note the state the job has transitioned to while
handling the blockjob state change event. Rename the field so that it's
obvious that this is the new state and not the general state of the
blockjob.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
{
qemuBlockJobDataPtr job = QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob;
qemuDomainObjPrivatePtr priv = vm->privateData;
- int status = job->status;
+ int state = job->newstate;
if (error)
*error = NULL;
- if (status != -1) {
+ if (state != -1) {
qemuBlockJobEventProcessLegacy(priv->driver, vm, disk, asyncJob,
- job->type, status);
- job->status = -1;
+ job->type, state);
+ job->newstate = -1;
if (error)
VIR_STEAL_PTR(*error, job->errmsg);
else
VIR_FREE(job->errmsg);
}
- return status;
+ return state;
}
VIR_DEBUG("disk=%s", disk->dst);
job->synchronous = true;
- job->status = -1;
+ job->newstate = -1;
}
bool started;
int type;
- int status;
char *errmsg;
bool synchronous; /* API call is waiting for this job */
+
+ int newstate; /* virConnectDomainEventBlockJobStatus - new state to be processed */
};
qemuBlockJobDataPtr qemuBlockJobDataNew(void);
job = QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob;
job->type = type;
- job->status = status;
+ job->newstate = status;
qemuBlockJobUpdateDisk(vm, QEMU_ASYNC_JOB_NONE, disk, NULL);
if (job->synchronous) {
/* We have a SYNC API waiting for this event, dispatch it back */
job->type = type;
- job->status = status;
+ job->newstate = status;
VIR_FREE(job->errmsg);
ignore_value(VIR_STRDUP_QUIET(job->errmsg, error));
virDomainObjBroadcast(vm);
}
job->started = true;
- job->status = -1;
+ job->newstate = -1;
return 0;
}