qemu: migration: Don't use return value of qemuBlockJobUpdate

Upcoming patch will remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Mores <pmores@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2020-03-26 13:14:12 +01:00
parent 496a44a7eb
commit 028cc19c65

View File

@ -510,7 +510,6 @@ qemuMigrationSrcNBDStorageCopyReady(virDomainObjPtr vm,
{ {
size_t i; size_t i;
size_t notReady = 0; size_t notReady = 0;
int status;
for (i = 0; i < vm->def->ndisks; i++) { for (i = 0; i < vm->def->ndisks; i++) {
virDomainDiskDefPtr disk = vm->def->disks[i]; virDomainDiskDefPtr disk = vm->def->disks[i];
@ -526,8 +525,8 @@ qemuMigrationSrcNBDStorageCopyReady(virDomainObjPtr vm,
return -1; return -1;
} }
status = qemuBlockJobUpdate(vm, job, asyncJob); qemuBlockJobUpdate(vm, job, asyncJob);
if (status == VIR_DOMAIN_BLOCK_JOB_FAILED) { if (job->state == VIR_DOMAIN_BLOCK_JOB_FAILED) {
qemuMigrationNBDReportMirrorError(job, disk->dst); qemuMigrationNBDReportMirrorError(job, disk->dst);
virObjectUnref(job); virObjectUnref(job);
return -1; return -1;
@ -567,7 +566,6 @@ qemuMigrationSrcNBDCopyCancelled(virDomainObjPtr vm,
size_t i; size_t i;
size_t active = 0; size_t active = 0;
size_t completed = 0; size_t completed = 0;
int status;
bool failed = false; bool failed = false;
retry: retry:
@ -582,8 +580,8 @@ qemuMigrationSrcNBDCopyCancelled(virDomainObjPtr vm,
if (!(job = qemuBlockJobDiskGetJob(disk))) if (!(job = qemuBlockJobDiskGetJob(disk)))
continue; continue;
status = qemuBlockJobUpdate(vm, job, asyncJob); qemuBlockJobUpdate(vm, job, asyncJob);
switch (status) { switch (job->state) {
case VIR_DOMAIN_BLOCK_JOB_FAILED: case VIR_DOMAIN_BLOCK_JOB_FAILED:
if (check) { if (check) {
qemuMigrationNBDReportMirrorError(job, disk->dst); qemuMigrationNBDReportMirrorError(job, disk->dst);
@ -599,7 +597,7 @@ qemuMigrationSrcNBDCopyCancelled(virDomainObjPtr vm,
active++; active++;
} }
if (status == VIR_DOMAIN_BLOCK_JOB_COMPLETED) if (job->state == VIR_DOMAIN_BLOCK_JOB_COMPLETED)
completed++; completed++;
virObjectUnref(job); virObjectUnref(job);
@ -650,11 +648,10 @@ qemuMigrationSrcNBDCopyCancelOne(virQEMUDriverPtr driver,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
int status;
int rv; int rv;
status = qemuBlockJobUpdate(vm, job, asyncJob); qemuBlockJobUpdate(vm, job, asyncJob);
switch (status) { switch (job->state) {
case VIR_DOMAIN_BLOCK_JOB_FAILED: case VIR_DOMAIN_BLOCK_JOB_FAILED:
case VIR_DOMAIN_BLOCK_JOB_CANCELED: case VIR_DOMAIN_BLOCK_JOB_CANCELED:
if (failNoJob) { if (failNoJob) {