mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
testQemuMonitorJSONqemuMonitorJSONGetChardevInfo: Remove superfluous goto
s
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
831568e831
commit
70f32d5ece
@ -1811,7 +1811,6 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *opaque)
|
|||||||
{
|
{
|
||||||
const testGenericData *data = opaque;
|
const testGenericData *data = opaque;
|
||||||
virDomainXMLOption *xmlopt = data->xmlopt;
|
virDomainXMLOption *xmlopt = data->xmlopt;
|
||||||
int ret = -1;
|
|
||||||
g_autoptr(GHashTable) info = NULL;
|
g_autoptr(GHashTable) info = NULL;
|
||||||
g_autoptr(GHashTable) expectedInfo = NULL;
|
g_autoptr(GHashTable) expectedInfo = NULL;
|
||||||
qemuMonitorChardevInfo info0 = { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT };
|
qemuMonitorChardevInfo info0 = { NULL, VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT };
|
||||||
@ -1825,7 +1824,7 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *opaque)
|
|||||||
|
|
||||||
if (!(info = virHashNew(qemuMonitorChardevInfoFree)) ||
|
if (!(info = virHashNew(qemuMonitorChardevInfoFree)) ||
|
||||||
!(expectedInfo = virHashNew(NULL)))
|
!(expectedInfo = virHashNew(NULL)))
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (virHashAddEntry(expectedInfo, "charserial1", &info1) < 0 ||
|
if (virHashAddEntry(expectedInfo, "charserial1", &info1) < 0 ||
|
||||||
virHashAddEntry(expectedInfo, "charserial0", &info2) < 0 ||
|
virHashAddEntry(expectedInfo, "charserial0", &info2) < 0 ||
|
||||||
@ -1833,7 +1832,7 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *opaque)
|
|||||||
virHashAddEntry(expectedInfo, "charserial2", &info3) < 0) {
|
virHashAddEntry(expectedInfo, "charserial2", &info3) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
"Unable to create expectedInfo hash table");
|
"Unable to create expectedInfo hash table");
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorTestAddItem(test, "query-chardev",
|
if (qemuMonitorTestAddItem(test, "query-chardev",
|
||||||
@ -1860,21 +1859,19 @@ testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *opaque)
|
|||||||
" ],"
|
" ],"
|
||||||
" \"id\": \"libvirt-15\""
|
" \"id\": \"libvirt-15\""
|
||||||
"}") < 0)
|
"}") < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (qemuMonitorJSONGetChardevInfo(qemuMonitorTestGetMonitor(test),
|
if (qemuMonitorJSONGetChardevInfo(qemuMonitorTestGetMonitor(test),
|
||||||
info) < 0)
|
info) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (!virHashEqual(info, expectedInfo, testHashEqualChardevInfo)) {
|
if (!virHashEqual(info, expectedInfo, testHashEqualChardevInfo)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
"Hashtable is different to the expected one");
|
"Hashtable is different to the expected one");
|
||||||
goto cleanup;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user