]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Use virTypedParams* APIs in domblkstat
authorJiri Denemark <jdenemar@redhat.com>
Tue, 15 Jan 2013 23:08:05 +0000 (00:08 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 18 Jan 2013 14:03:59 +0000 (15:03 +0100)
tools/virsh-domain-monitor.c
tools/virsh.c

index f60ecba479c6a7f51648eef422c39b700c014550..1e8b8cfe2ce624f22e47682c8320f2c5e563ff61 100644 (file)
@@ -941,9 +941,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);
index 63715fbc84ebd0f4ee35b61d3994e2f650846442..908c6a117d33e644c3aee65af790b954f8ac20c6 100644 (file)
@@ -2056,26 +2056,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, ...)
 {