mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virsh: Use virTypedParams* APIs in domblkstat
This commit is contained in:
parent
e982dacb45
commit
2e467de44a
@ -941,9 +941,8 @@ cmdDomblkstat(vshControl *ctl, const vshCmd *cmd)
|
|||||||
|
|
||||||
/* at first print all known values in desired order */
|
/* at first print all known values in desired order */
|
||||||
for (i = 0; domblkstat_output[i].field != NULL; i++) {
|
for (i = 0; domblkstat_output[i].field != NULL; i++) {
|
||||||
if (!(par = vshFindTypedParamByName(domblkstat_output[i].field,
|
if (!(par = virTypedParamsGet(params, nparams,
|
||||||
params,
|
domblkstat_output[i].field)))
|
||||||
nparams)))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
value = vshGetTypedParamValue(ctl, par);
|
value = vshGetTypedParamValue(ctl, par);
|
||||||
|
@ -2056,26 +2056,6 @@ vshGetTypedParamValue(vshControl *ctl, virTypedParameterPtr item)
|
|||||||
return str;
|
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
|
void
|
||||||
vshDebug(vshControl *ctl, int level, const char *format, ...)
|
vshDebug(vshControl *ctl, int level, const char *format, ...)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user