forked from rpms/libvirt
ff5db98bff
- src: Don't use virReportSystemError() on virProcessGetStatInfo() failure (rhbz#2148266) - qemu: Provide virDomainGetCPUStats() implementation for session connection (rhbz#2148266) - virsh: Make domif-setlink work more than once (rhbz#2165466) - qemu_fd: Remove declaration for 'qemuFDPassNewDirect' (rhbz#2040272) - qemuStorageSourcePrivateDataFormat: Rename 'tmp' to 'objectsChildBuf' (rhbz#2040272) - qemu: command: Handle FD passing commandline via qemuBuildBlockStorageSourceAttachDataCommandline (rhbz#2040272) - qemuFDPassTransferCommand: Mark that FD was passed (rhbz#2040272) - qemu: fd: Add helpers allowing storing FD set data in status XML (rhbz#2040272) - qemu: domain: Store fdset ID for disks passed to qemu via FD (rhbz#2040272) - qemu: block: Properly handle FD-passed disk hot-(un-)plug (rhbz#2040272) Resolves: rhbz#2040272, rhbz#2148266, rhbz#2165466
62 lines
2.7 KiB
Diff
62 lines
2.7 KiB
Diff
From a967747fcdf7d78425d218625ddb42606451c2ab Mon Sep 17 00:00:00 2001
|
|
Message-Id: <a967747fcdf7d78425d218625ddb42606451c2ab@dist-git>
|
|
From: Michal Privoznik <mprivozn@redhat.com>
|
|
Date: Wed, 18 Jan 2023 09:03:29 +0100
|
|
Subject: [PATCH] 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>
|
|
(cherry picked from commit 818c9717c53446ca7abbaa7b3fd7925e1c5ab663)
|
|
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2148266
|
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
|
---
|
|
src/ch/ch_driver.c | 4 ++--
|
|
src/qemu/qemu_driver.c | 4 ++--
|
|
2 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c
|
|
index db2a66d131..12fbe31c24 100644
|
|
--- a/src/ch/ch_driver.c
|
|
+++ b/src/ch/ch_driver.c
|
|
@@ -1079,8 +1079,8 @@ chDomainHelperGetVcpus(virDomainObj *vm,
|
|
NULL, NULL,
|
|
&vcpuinfo->cpu, NULL,
|
|
vm->pid, vcpupid) < 0) {
|
|
- virReportSystemError(errno, "%s",
|
|
- _("cannot get vCPU placement & pCPU time"));
|
|
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
+ _("cannot get vCPU placement & pCPU time"));
|
|
return -1;
|
|
}
|
|
}
|
|
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
index d6879175fe..c576c601ad 100644
|
|
--- a/src/qemu/qemu_driver.c
|
|
+++ b/src/qemu/qemu_driver.c
|
|
@@ -1355,8 +1355,8 @@ qemuDomainHelperGetVcpus(virDomainObj *vm,
|
|
NULL, NULL,
|
|
&vcpuinfo->cpu, NULL,
|
|
vm->pid, vcpupid) < 0) {
|
|
- virReportSystemError(errno, "%s",
|
|
- _("cannot get vCPU placement & pCPU time"));
|
|
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
+ _("cannot get vCPU placement & pCPU time"));
|
|
return -1;
|
|
}
|
|
}
|
|
--
|
|
2.39.1
|
|
|