On 07/16/2016 04:15 AM, Qiaowei Ren wrote: > This patch rename qemuDomainGetStatsPerfRdt() to > qemuDomainGetStatsPerfOneEvent() and update qemuDomainGetStatsPerf() > based on this change for multiple/general purpose. > > Signed-off-by: Qiaowei Ren <qiaowei.ren@xxxxxxxxx> > --- > src/qemu/qemu_driver.c | 19 +++++++------------ > 1 file changed, 7 insertions(+), 12 deletions(-) > This really should be two patches - one to rename the function and one to remove the switch. John > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c > index cda85f6..1fdb7b8 100644 > --- a/src/qemu/qemu_driver.c > +++ b/src/qemu/qemu_driver.c > @@ -18938,10 +18938,10 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, > #undef QEMU_ADD_COUNT_PARAM > > static int > -qemuDomainGetStatsPerfRdt(virPerfPtr perf, > - virPerfEventType type, > - virDomainStatsRecordPtr record, > - int *maxparams) > +qemuDomainGetStatsPerfOneEvent(virPerfPtr perf, > + virPerfEventType type, > + virDomainStatsRecordPtr record, > + int *maxparams) > { > char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; > uint64_t value = 0; > @@ -18977,14 +18977,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 (qemuDomainGetStatsPerfRdt(priv->perf, i, record, maxparams) < 0) > - goto cleanup; > - break; > - } > + if (qemuDomainGetStatsPerfOneEvent(priv->perf, i, > + record, maxparams) < 0) > + goto cleanup; > } > > ret = 0; > -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list