- Revert commit 938382b60a since it changes semantics on some

public APIs
  105dace2-revert-virProcessGetStatInfo.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=920
This commit is contained in:
James Fehlig 2022-01-26 19:17:52 +00:00 committed by Git OBS Bridge
parent 312ad341c9
commit bf3e3feba0
4 changed files with 103 additions and 3 deletions

View File

@ -241,7 +241,7 @@ Index: libvirt-8.0.0/src/qemu/qemu_driver.c
#include "domain_audit.h" #include "domain_audit.h"
#include "domain_cgroup.h" #include "domain_cgroup.h"
#include "domain_driver.h" #include "domain_driver.h"
@@ -17407,13 +17408,7 @@ qemuDomainGetStatsState(virQEMUDriver *d @@ -17412,13 +17413,7 @@ qemuDomainGetStatsState(virQEMUDriver *d
virTypedParamList *params, virTypedParamList *params,
unsigned int privflags G_GNUC_UNUSED) unsigned int privflags G_GNUC_UNUSED)
{ {
@ -256,7 +256,7 @@ Index: libvirt-8.0.0/src/qemu/qemu_driver.c
} }
@@ -17705,25 +17700,11 @@ qemuDomainGetStatsCpuCgroup(virDomainObj @@ -17710,25 +17705,11 @@ qemuDomainGetStatsCpuCgroup(virDomainObj
virTypedParamList *params) virTypedParamList *params)
{ {
qemuDomainObjPrivate *priv = dom->privateData; qemuDomainObjPrivate *priv = dom->privateData;
@ -283,7 +283,7 @@ Index: libvirt-8.0.0/src/qemu/qemu_driver.c
} }
static int static int
@@ -17916,76 +17897,15 @@ qemuDomainGetStatsVcpu(virQEMUDriver *dr @@ -17921,76 +17902,15 @@ qemuDomainGetStatsVcpu(virQEMUDriver *dr
return ret; return ret;
} }

View File

@ -0,0 +1,92 @@
commit 105dace22cc7b5b18d72a4dcad4a2cf386ce5c99
Author: Michal Prívozník <mprivozn@redhat.com>
Date: Tue Jan 18 12:40:09 2022 +0100
Revert "report error when virProcessGetStatInfo() is unable to parse data"
This reverts commit 938382b60ae5bd1f83b5cb09e1ce68b9a88f679a.
Turns out, the commit did more harm than good. It changed
semantics on some public APIs. For instance, while
qemuDomainGetInfo() previously did not returned an error it does
now. While the calls to virProcessGetStatInfo() is guarded with
virDomainObjIsActive() it doesn't necessarily mean that QEMU's
PID is still alive. QEMU might be gone but we just haven't
realized it (e.g. because the eof handler thread is waiting for a
job).
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2041610
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Index: libvirt-8.0.0/src/ch/ch_driver.c
===================================================================
--- libvirt-8.0.0.orig/src/ch/ch_driver.c
+++ libvirt-8.0.0/src/ch/ch_driver.c
@@ -1073,6 +1073,8 @@ chDomainHelperGetVcpus(virDomainObj *vm,
if (virProcessGetStatInfo(&vcpuinfo->cpuTime,
&vcpuinfo->cpu, NULL,
vm->pid, vcpupid) < 0) {
+ virReportSystemError(errno, "%s",
+ _("cannot get vCPU placement & pCPU time"));
return -1;
}
}
Index: libvirt-8.0.0/src/qemu/qemu_driver.c
===================================================================
--- libvirt-8.0.0.orig/src/qemu/qemu_driver.c
+++ libvirt-8.0.0/src/qemu/qemu_driver.c
@@ -1359,6 +1359,8 @@ qemuDomainHelperGetVcpus(virDomainObj *v
if (virProcessGetStatInfo(&vcpuinfo->cpuTime,
&vcpuinfo->cpu, NULL,
vm->pid, vcpupid) < 0) {
+ virReportSystemError(errno, "%s",
+ _("cannot get vCPU placement & pCPU time"));
return -1;
}
}
@@ -2519,6 +2521,8 @@ qemuDomainGetInfo(virDomainPtr dom,
if (virDomainObjIsActive(vm)) {
if (virProcessGetStatInfo(&(info->cpuTime), NULL, NULL,
vm->pid, 0) < 0) {
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("cannot read cputime for domain"));
goto cleanup;
}
}
@@ -10526,7 +10530,8 @@ qemuDomainMemoryStatsInternal(virQEMUDri
}
if (virProcessGetStatInfo(NULL, NULL, &rss, vm->pid, 0) < 0) {
- virResetLastError();
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("cannot get RSS for domain"));
} else {
stats[ret].tag = VIR_DOMAIN_MEMORY_STAT_RSS;
stats[ret].val = rss;
Index: libvirt-8.0.0/src/util/virprocess.c
===================================================================
--- libvirt-8.0.0.orig/src/util/virprocess.c
+++ libvirt-8.0.0/src/util/virprocess.c
@@ -1784,10 +1784,7 @@ virProcessGetStatInfo(unsigned long long
virStrToLong_ullp(proc_stat[VIR_PROCESS_STAT_STIME], NULL, 10, &systime) < 0 ||
virStrToLong_l(proc_stat[VIR_PROCESS_STAT_RSS], NULL, 10, &rss) < 0 ||
virStrToLong_i(proc_stat[VIR_PROCESS_STAT_PROCESSOR], NULL, 10, &cpu) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse process status data for pid '%d/%d'"),
- (int) pid, (int) tid);
- return -1;
+ VIR_WARN("cannot parse process status data");
}
/* We got jiffies
@@ -1884,8 +1881,7 @@ virProcessGetStatInfo(unsigned long long
pid_t pid G_GNUC_UNUSED,
pid_t tid G_GNUC_UNUSED)
{
- virReportSystemError(ENOSYS, "%s",
- _("Process statistics data is not supported on this platform"));
+ errno = ENOSYS;
return -1;
}

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Jan 26 19:13:24 UTC 2022 - James Fehlig <jfehlig@suse.com>
- Revert commit 938382b60a since it changes semantics on some
public APIs
105dace2-revert-virProcessGetStatInfo.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jan 25 16:26:42 UTC 2022 - James Fehlig <jfehlig@suse.com> Tue Jan 25 16:26:42 UTC 2022 - James Fehlig <jfehlig@suse.com>

View File

@ -305,6 +305,7 @@ Patch0: 3be5ba11-libvirt-guests-install.patch
Patch1: 16172741-libvirt-guests-manpage.patch Patch1: 16172741-libvirt-guests-manpage.patch
Patch2: 8eb44616-remove-sysconfig-files.patch Patch2: 8eb44616-remove-sysconfig-files.patch
Patch3: 31e937fb-libxl-save-lock-indicator.patch Patch3: 31e937fb-libxl-save-lock-indicator.patch
Patch4: 105dace2-revert-virProcessGetStatInfo.patch
# Patches pending upstream review # Patches pending upstream review
Patch100: libxl-dom-reset.patch Patch100: libxl-dom-reset.patch
Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch