Accepting request 949336 from Virtualization

- Revert commit 938382b60a since it changes semantics on some
  public APIs
  105dace2-revert-virProcessGetStatInfo.patch

- libxl: Add lock process indicator to saved VM state
  31e937fb-libxl-save-lock-indicator.patch
  bsc#1191668

OBS-URL: https://build.opensuse.org/request/show/949336
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libvirt?expand=0&rev=347
This commit is contained in:
Dominique Leuenberger 2022-01-27 22:16:36 +00:00 committed by Git OBS Bridge
commit aa2cb7b43f
5 changed files with 153 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_cgroup.h"
#include "domain_driver.h"
@@ -17407,13 +17408,7 @@ qemuDomainGetStatsState(virQEMUDriver *d
@@ -17412,13 +17413,7 @@ qemuDomainGetStatsState(virQEMUDriver *d
virTypedParamList *params,
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)
{
qemuDomainObjPrivate *priv = dom->privateData;
@ -283,7 +283,7 @@ Index: libvirt-8.0.0/src/qemu/qemu_driver.c
}
static int
@@ -17916,76 +17897,15 @@ qemuDomainGetStatsVcpu(virQEMUDriver *dr
@@ -17921,76 +17902,15 @@ qemuDomainGetStatsVcpu(virQEMUDriver *dr
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

@ -0,0 +1,42 @@
commit 31e937fb3b7d0aa040a879394eff700bc1108251
Author: Jim Fehlig <jfehlig@suse.com>
Date: Mon Jan 24 12:03:20 2022 -0700
libxl: Add lock process indicator to saved VM state
Commit fa58f571ee added a lock processes indicator to the
libxlDomainObjPrivate struct to note that a lock process was
successfully started for the VM. However, the commit neglected to
add the indicator to the VM's saved state file. As a result, the
indicator is lost on libvirtd restart, along with the knowledge of
whether a lock process was started for the VM.
This change adds support for the indicator in the domainObjPrivate
data parse and format callbacks, ensuring its value survives libvirtd
restarts.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Index: libvirt-8.0.0/src/libxl/libxl_domain.c
===================================================================
--- libvirt-8.0.0.orig/src/libxl/libxl_domain.c
+++ libvirt-8.0.0/src/libxl/libxl_domain.c
@@ -226,6 +226,7 @@ libxlDomainObjPrivateXMLParse(xmlXPathCo
libxlDomainObjPrivate *priv = vm->privateData;
priv->lockState = virXPathString("string(./lockstate)", ctxt);
+ priv->lockProcessRunning = virXPathBoolean("boolean(./lockProcessRunning)", ctxt);
return 0;
}
@@ -239,6 +240,9 @@ libxlDomainObjPrivateXMLFormat(virBuffer
if (priv->lockState)
virBufferAsprintf(buf, "<lockstate>%s</lockstate>\n", priv->lockState);
+ if (priv->lockProcessRunning)
+ virBufferAddLit(buf, "<lockProcessRunning/>\n");
+
return 0;
}

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
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>
- libxl: Add lock process indicator to saved VM state
31e937fb-libxl-save-lock-indicator.patch
bsc#1191668
-------------------------------------------------------------------
Tue Jan 18 17:11:13 UTC 2022 - James Fehlig <jfehlig@suse.com>

View File

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