[libvirt] [PATCH 06/12] virsh: Use virTypedParams* APIs in domblkstat

Jiri Denemark jdenemar at redhat.com
Wed Jan 16 14:20:11 UTC 2013


---
 tools/virsh-domain-monitor.c |  5 ++---
 tools/virsh.c                | 20 --------------------
 2 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
index f4940fa..72d2af1 100644
--- a/tools/virsh-domain-monitor.c
+++ b/tools/virsh-domain-monitor.c
@@ -880,9 +880,8 @@ cmdDomblkstat(vshControl *ctl, const vshCmd *cmd)
 
         /* at first print all known values in desired order */
         for (i = 0; domblkstat_output[i].field != NULL; i++) {
-            if (!(par = vshFindTypedParamByName(domblkstat_output[i].field,
-                                                params,
-                                                nparams)))
+            if (!(par = virTypedParamsGet(params, nparams,
+                                          domblkstat_output[i].field)))
                 continue;
 
             value = vshGetTypedParamValue(ctl, par);
diff --git a/tools/virsh.c b/tools/virsh.c
index 669c9c9..31cc5a1 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2028,26 +2028,6 @@ vshGetTypedParamValue(vshControl *ctl, virTypedParameterPtr item)
     return str;
 }
 
-virTypedParameterPtr
-vshFindTypedParamByName(const char *name, virTypedParameterPtr list, int count)
-{
-    int i = count;
-    virTypedParameterPtr found = list;
-
-    if (!list || !name)
-        return NULL;
-
-    while (i-- > 0) {
-        if (STREQ(name, found->field))
-            return found;
-
-        found++; /* go to next struct in array */
-    }
-
-    /* not found */
-    return NULL;
-}
-
 void
 vshDebug(vshControl *ctl, int level, const char *format, ...)
 {
-- 
1.8.1.1




More information about the libvir-list mailing list