src: Don't use virReportSystemError() on virProcessGetStatInfo() failure

Firstly, the virProcessGetStatInfo() does not fail really. But
even if it did, it sets correct errno only sometimes (and even
that is done in a helper it's calling - virProcessGetStat() and
even there it's the case only in very few error paths).

Therefore, using virReportSystemError() to report errors is very
misleading. Use plain virReportError() instead. Luckily, there
are only two places where the former was used:
chDomainHelperGetVcpus() and qemuDomainHelperGetVcpus() (not a
big surprise since CH driver is heavily inspired by QEMU driver).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Michal Privoznik 2023-01-18 09:03:29 +01:00
parent 1c7476c879
commit 818c9717c5
2 changed files with 4 additions and 4 deletions

View File

@ -1079,8 +1079,8 @@ chDomainHelperGetVcpus(virDomainObj *vm,
NULL, NULL, NULL, NULL,
&vcpuinfo->cpu, NULL, &vcpuinfo->cpu, NULL,
vm->pid, vcpupid) < 0) { vm->pid, vcpupid) < 0) {
virReportSystemError(errno, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot get vCPU placement & pCPU time")); _("cannot get vCPU placement & pCPU time"));
return -1; return -1;
} }
} }

View File

@ -1355,8 +1355,8 @@ qemuDomainHelperGetVcpus(virDomainObj *vm,
NULL, NULL, NULL, NULL,
&vcpuinfo->cpu, NULL, &vcpuinfo->cpu, NULL,
vm->pid, vcpupid) < 0) { vm->pid, vcpupid) < 0) {
virReportSystemError(errno, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot get vCPU placement & pCPU time")); _("cannot get vCPU placement & pCPU time"));
return -1; return -1;
} }
} }