mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +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")))
|
||||
return -1;
|
||||
|
||||
return g_strv_length(*array);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int qemuMonitorJSONGetTPMModels(qemuMonitor *mon,
|
||||
|
@ -561,7 +561,6 @@ testQemuMonitorJSONGetTPMModels(const void *opaque)
|
||||
const testGenericData *data = opaque;
|
||||
virDomainXMLOption *xmlopt = data->xmlopt;
|
||||
g_auto(GStrv) tpmmodels = NULL;
|
||||
int ntpmmodels = 0;
|
||||
g_autoptr(qemuMonitorTest) test = NULL;
|
||||
|
||||
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
|
||||
@ -575,13 +574,12 @@ testQemuMonitorJSONGetTPMModels(const void *opaque)
|
||||
"}") < 0)
|
||||
return -1;
|
||||
|
||||
if ((ntpmmodels = qemuMonitorGetTPMModels(qemuMonitorTestGetMonitor(test),
|
||||
&tpmmodels)) < 0)
|
||||
if (qemuMonitorGetTPMModels(qemuMonitorTestGetMonitor(test), &tpmmodels) < 0)
|
||||
return -1;
|
||||
|
||||
if (ntpmmodels != 1) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"ntpmmodels %d is not 1", ntpmmodels);
|
||||
if (g_strv_length(tpmmodels) != 1) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
"expected 1 tpm model");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user