[libvirt] [PATCH] esx: Fix check in esxDomainGetInfo's perf metric handling

--- src/esx/esx_driver.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 8bc3be2..1b4ee29 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -2329,15 +2329,17 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) perfEntityMetric = esxVI_PerfEntityMetric_DynamicCast(perfEntityMetricBase); - if (perfMetricIntSeries == NULL) { - VIR_ERROR0(_("QueryPerf returned object with unexpected type")); + if (perfEntityMetric == NULL) { + VIR_ERROR(_("QueryPerf returned object with unexpected type '%s'"), + esxVI_Type_ToString(perfEntityMetricBase->_type)); } perfMetricIntSeries = esxVI_PerfMetricIntSeries_DynamicCast(perfEntityMetric->value); if (perfMetricIntSeries == NULL) { - VIR_ERROR0(_("QueryPerf returned object with unexpected type")); + VIR_ERROR(_("QueryPerf returned object with unexpected type '%s'"), + esxVI_Type_ToString(perfEntityMetric->value->_type)); } for (; perfMetricIntSeries != NULL; -- 1.7.0.4

On 10/15/2010 12:47 PM, Matthias Bolte wrote:
--- src/esx/esx_driver.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 8bc3be2..1b4ee29 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -2329,15 +2329,17 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) perfEntityMetric = esxVI_PerfEntityMetric_DynamicCast(perfEntityMetricBase);
- if (perfMetricIntSeries == NULL) { - VIR_ERROR0(_("QueryPerf returned object with unexpected type")); + if (perfEntityMetric == NULL) { + VIR_ERROR(_("QueryPerf returned object with unexpected type '%s'"), + esxVI_Type_ToString(perfEntityMetricBase->_type)); }
perfMetricIntSeries = esxVI_PerfMetricIntSeries_DynamicCast(perfEntityMetric->value);
ACK - looks like a copy-and-paste fix, in the category of "how did it ever possibly work when it was originally committed?". -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

2010/10/15 Eric Blake <eblake@redhat.com>:
On 10/15/2010 12:47 PM, Matthias Bolte wrote:
--- src/esx/esx_driver.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 8bc3be2..1b4ee29 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -2329,15 +2329,17 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) perfEntityMetric =
esxVI_PerfEntityMetric_DynamicCast(perfEntityMetricBase);
- if (perfMetricIntSeries == NULL) { - VIR_ERROR0(_("QueryPerf returned object with unexpected type")); + if (perfEntityMetric == NULL) { + VIR_ERROR(_("QueryPerf returned object with unexpected type '%s'"), + esxVI_Type_ToString(perfEntityMetricBase->_type)); }
perfMetricIntSeries =
esxVI_PerfMetricIntSeries_DynamicCast(perfEntityMetric->value);
ACK - looks like a copy-and-paste fix, in the category of "how did it ever possibly work when it was originally committed?".
Exactly :) Thanks, pushed. Matthias
participants (2)
-
Eric Blake
-
Matthias Bolte