[libvirt] [PATCH v5 2/8] perf: Remove the switch from qemuDomainGetStatsPerf

John Ferlan jferlan at redhat.com
Wed Aug 3 22:30:49 UTC 2016


From: Qiaowei Ren <qiaowei.ren at intel.com>

Remove the unnecessary switch since all VIR_PERF_EVENT* values are fetched

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/qemu/qemu_driver.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c45207e..b41eaa3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -19172,15 +19172,9 @@ qemuDomainGetStatsPerf(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
         if (!virPerfEventIsEnabled(priv->perf, i))
              continue;
 
-        switch (i) {
-        case VIR_PERF_EVENT_CMT:
-        case VIR_PERF_EVENT_MBMT:
-        case VIR_PERF_EVENT_MBML:
-            if (qemuDomainGetStatsPerfOneEvent(priv->perf, i, record,
-                                               maxparams) < 0)
-                goto cleanup;
-            break;
-        }
+        if (qemuDomainGetStatsPerfOneEvent(priv->perf, i,
+                                           record, maxparams) < 0)
+            goto cleanup;
     }
 
     ret = 0;
-- 
2.7.4




More information about the libvir-list mailing list