]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuConnectGetAllDomainStats: Simplify qemuDomainGetStats() error handling
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 11 Nov 2021 10:26:54 +0000 (11:26 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 2 Dec 2021 15:57:44 +0000 (16:57 +0100)
commit8ad2edad944cb80ac2db9d138b0b1b4bb49032f5
treede6ebf6706d67d4594a69ffb800044bf06b32769
parent2c6b8cb507062286bab6da9428adff5ab88b4ebf
qemuConnectGetAllDomainStats: Simplify qemuDomainGetStats() error handling

In qemuConnectGetAllDomainStats() there a loop that iterates over
all domains that stats are to be fetched for. Within this loop
the qemuDomainGetStats() is called which is responsible for
fetching stats for an individual domain. Now, the code that
handles successful and failure cases is almost the same. Rework
it, so that the code is deduplicated. Note, that the check for
!tmp is dropped because upon successful return from
qemuDomainGetStats() it is always allocated.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c