From 8d5bba08c7432353baa4374737555b8ccccce7f0 Mon Sep 17 00:00:00 2001 From: Wang Huaqiang Date: Mon, 12 Nov 2018 21:31:46 +0800 Subject: [PATCH] qemu: Refactor qemuDomainGetStatsCpu Refactoring qemuDomainGetStatsCpu, make it possible to add more CPU statistics. Signed-off-by: Wang Huaqiang Reviewed-by: John Ferlan --- src/qemu/qemu_driver.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 09e04b8544..85cbf7a028 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19699,11 +19699,9 @@ typedef enum { static int -qemuDomainGetStatsCpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, - virDomainObjPtr dom, - virDomainStatsRecordPtr record, - int *maxparams, - unsigned int privflags ATTRIBUTE_UNUSED) +qemuDomainGetStatsCpuCgroup(virDomainObjPtr dom, + virDomainStatsRecordPtr record, + int *maxparams) { qemuDomainObjPrivatePtr priv = dom->privateData; unsigned long long cpu_time = 0; @@ -19739,6 +19737,18 @@ qemuDomainGetStatsCpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, return 0; } + +static int +qemuDomainGetStatsCpu(virQEMUDriverPtr driver ATTRIBUTE_UNUSED, + virDomainObjPtr dom, + virDomainStatsRecordPtr record, + int *maxparams, + unsigned int privflags ATTRIBUTE_UNUSED) +{ + return qemuDomainGetStatsCpuCgroup(dom, record, maxparams); +} + + static int qemuDomainGetStatsBalloon(virQEMUDriverPtr driver, virDomainObjPtr dom, -- GitLab