test_driver: Don't report VIR_DOMAIN_DISK_ERROR_NONE

In my review of 89320788ac I've simplified assigning disk errors
too much as the code I've changed it to will set
VIR_DOMAIN_DISK_ERROR_NONE. This is in contradiction with our
documentation which specifies that disks with no errors are not
reported.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Michal Privoznik 2019-05-14 17:09:19 +02:00
parent 3b1a5dde79
commit 0ff84542a5

View File

@ -3277,7 +3277,7 @@ static int testDomainGetDiskErrors(virDomainPtr dom,
for (i = 0; i < MIN(vm->def->ndisks, maxerrors); i++) { for (i = 0; i < MIN(vm->def->ndisks, maxerrors); i++) {
if (VIR_STRDUP(errors[i].disk, vm->def->disks[i]->dst) < 0) if (VIR_STRDUP(errors[i].disk, vm->def->disks[i]->dst) < 0)
goto cleanup; goto cleanup;
errors[i].error = i % VIR_DOMAIN_DISK_ERROR_LAST; errors[i].error = (i % (VIR_DOMAIN_DISK_ERROR_LAST - 1)) + 1;
} }
ret = i; ret = i;
} else { } else {