mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
qemuDomainGetStatsPerfOneEvent: Ignore erros from 'virPerfReadEvent'
The bulk domain stats API is meant to collect as much data as possible without erroring out. Skip the perf stats if we can't fetch them instead of erroring out. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
613901baec
commit
f05f54d8fb
@ -17575,23 +17575,17 @@ qemuDomainGetStatsIOThread(virQEMUDriver *driver G_GNUC_UNUSED,
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
static void
|
||||
qemuDomainGetStatsPerfOneEvent(virPerf *perf,
|
||||
virPerfEventType type,
|
||||
virTypedParamList *params)
|
||||
{
|
||||
uint64_t value = 0;
|
||||
int rv;
|
||||
|
||||
if ((rv = virPerfReadEvent(perf, type, &value)) < 0) {
|
||||
virReportSystemError(-rv, "%s",
|
||||
_("Unable to read cache data"));
|
||||
return -1;
|
||||
}
|
||||
if (virPerfReadEvent(perf, type, &value) < 0)
|
||||
return;
|
||||
|
||||
virTypedParamListAddULLong(params, value, "perf.%s", virPerfEventTypeToString(type));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -17607,8 +17601,7 @@ qemuDomainGetStatsPerf(virQEMUDriver *driver G_GNUC_UNUSED,
|
||||
if (!virPerfEventIsEnabled(priv->perf, i))
|
||||
continue;
|
||||
|
||||
if (qemuDomainGetStatsPerfOneEvent(priv->perf, i, params) < 0)
|
||||
return -1;
|
||||
qemuDomainGetStatsPerfOneEvent(priv->perf, i, params);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user