mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
tests: remove unneeded labels
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
9b1007d004
commit
67ded67321
@ -1078,15 +1078,13 @@ qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlopt,
|
||||
if (virNetSocketListen(test->server, 1) < 0)
|
||||
goto error;
|
||||
|
||||
cleanup:
|
||||
return test;
|
||||
|
||||
error:
|
||||
VIR_FREE(path);
|
||||
VIR_FREE(tmpdir_template);
|
||||
qemuMonitorTestFree(test);
|
||||
test = NULL;
|
||||
goto cleanup;
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
@ -1100,10 +1098,10 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test)
|
||||
return -1;
|
||||
|
||||
if (virNetSocketAccept(test->server, &test->client) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
if (!test->client)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
if (test->outgoingLength > 0)
|
||||
events = VIR_EVENT_HANDLE_WRITABLE;
|
||||
@ -1113,7 +1111,7 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test)
|
||||
qemuMonitorTestIO,
|
||||
test,
|
||||
NULL) < 0)
|
||||
goto error;
|
||||
return -1;
|
||||
|
||||
virMutexLock(&test->lock);
|
||||
if (virThreadCreate(&test->thread,
|
||||
@ -1121,15 +1119,12 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test)
|
||||
qemuMonitorTestWorker,
|
||||
test) < 0) {
|
||||
virMutexUnlock(&test->lock);
|
||||
goto error;
|
||||
return -1;
|
||||
}
|
||||
test->started = test->running = true;
|
||||
virMutexUnlock(&test->lock);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -449,10 +449,9 @@ testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps,
|
||||
{
|
||||
virGICCapability *gicCapabilities = NULL;
|
||||
size_t ngicCapabilities = 0;
|
||||
int ret = -1;
|
||||
|
||||
if (VIR_ALLOC_N(gicCapabilities, 2) < 0)
|
||||
goto out;
|
||||
return -1;
|
||||
|
||||
# define IMPL_BOTH \
|
||||
VIR_GIC_IMPLEMENTATION_KERNEL|VIR_GIC_IMPLEMENTATION_EMULATED
|
||||
@ -473,10 +472,7 @@ testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps,
|
||||
virQEMUCapsSetGICCapabilities(qemuCaps,
|
||||
gicCapabilities, ngicCapabilities);
|
||||
|
||||
ret = 0;
|
||||
|
||||
out:
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -539,8 +539,6 @@ testVirHostdevOther(const void *opaque G_GNUC_UNUSED)
|
||||
static int
|
||||
testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED)
|
||||
{
|
||||
int ret = -1;
|
||||
|
||||
/* Don't rely on a state that previous test cases might have
|
||||
* left the manager in. Start with a clean slate. */
|
||||
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
|
||||
@ -552,7 +550,7 @@ testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED)
|
||||
|
||||
/* Firstly, attach all NVMe disks */
|
||||
if (virHostdevPrepareNVMeDevices(mgr, drv_name, dom_name, disks, ndisks) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 3);
|
||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 2);
|
||||
@ -560,7 +558,7 @@ testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED)
|
||||
|
||||
/* Now, try to detach the first one. */
|
||||
if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, disks, 1) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 2);
|
||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 2);
|
||||
@ -568,7 +566,7 @@ testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED)
|
||||
|
||||
/* And the last one */
|
||||
if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, &disks[2], 1) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 1);
|
||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 1);
|
||||
@ -576,15 +574,13 @@ testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED)
|
||||
|
||||
/* Finally, detach the middle one */
|
||||
if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, &disks[1], 1) < 0)
|
||||
goto cleanup;
|
||||
return -1;
|
||||
|
||||
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 0);
|
||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 0);
|
||||
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, 0);
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user