]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virPerfEventIsEnabled: Accept NULL @perf
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 4 May 2017 14:27:45 +0000 (16:27 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 4 May 2017 14:42:25 +0000 (16:42 +0200)
commit033369c7d99d16d11ad76cd137d801dfda40ccda
tree0056b9df9600c3ce6172b19432cf8861b345a33a
parent574718d366170b22227eda640ad94f414e9c7e2f
virPerfEventIsEnabled: Accept NULL @perf

After bdcf6e481 there is a crasher in libvirt. The commit assumes
that priv->perf is always set. That is not true. For inactive
domains, the priv->perf is not allocated as it is set in
qemuProcessLaunch(). Now, usually we differentiate between
accesses to inactive and active definition and it works just
fine. Except for 'domstats'. There priv->perf is accessed without
prior check for domain inactivity. While we could check for that,
more robust solution is to make virPerfEventIsEnabled() accept
NULL.

How to reproduce:
1) ensure you have at least one inactive domain
2) virsh domstats

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
src/util/virperf.c