mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemuMonitorJSONGetStringArray: Don't return element count
There's just one caller who cares (testQemuMonitorJSONGetTPMModels). Fix it and remove the counting of elements. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a5bc5f0ecf
commit
99908b930d
@ -7219,7 +7219,7 @@ qemuMonitorJSONGetStringArray(qemuMonitor *mon,
|
|||||||
if (!(*array = virJSONValueObjectGetStringArray(reply, "return")))
|
if (!(*array = virJSONValueObjectGetStringArray(reply, "return")))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return g_strv_length(*array);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qemuMonitorJSONGetTPMModels(qemuMonitor *mon,
|
int qemuMonitorJSONGetTPMModels(qemuMonitor *mon,
|
||||||
|
@ -561,7 +561,6 @@ testQemuMonitorJSONGetTPMModels(const void *opaque)
|
|||||||
const testGenericData *data = opaque;
|
const testGenericData *data = opaque;
|
||||||
virDomainXMLOption *xmlopt = data->xmlopt;
|
virDomainXMLOption *xmlopt = data->xmlopt;
|
||||||
g_auto(GStrv) tpmmodels = NULL;
|
g_auto(GStrv) tpmmodels = NULL;
|
||||||
int ntpmmodels = 0;
|
|
||||||
g_autoptr(qemuMonitorTest) test = NULL;
|
g_autoptr(qemuMonitorTest) test = NULL;
|
||||||
|
|
||||||
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
|
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
|
||||||
@ -575,13 +574,12 @@ testQemuMonitorJSONGetTPMModels(const void *opaque)
|
|||||||
"}") < 0)
|
"}") < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if ((ntpmmodels = qemuMonitorGetTPMModels(qemuMonitorTestGetMonitor(test),
|
if (qemuMonitorGetTPMModels(qemuMonitorTestGetMonitor(test), &tpmmodels) < 0)
|
||||||
&tpmmodels)) < 0)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (ntpmmodels != 1) {
|
if (g_strv_length(tpmmodels) != 1) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
"ntpmmodels %d is not 1", ntpmmodels);
|
"expected 1 tpm model");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user