mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 06:55:18 +00: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)
|
if (virNetSocketListen(test->server, 1) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return test;
|
return test;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(path);
|
VIR_FREE(path);
|
||||||
VIR_FREE(tmpdir_template);
|
VIR_FREE(tmpdir_template);
|
||||||
qemuMonitorTestFree(test);
|
qemuMonitorTestFree(test);
|
||||||
test = NULL;
|
return NULL;
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1100,10 +1098,10 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virNetSocketAccept(test->server, &test->client) < 0)
|
if (virNetSocketAccept(test->server, &test->client) < 0)
|
||||||
goto error;
|
return -1;
|
||||||
|
|
||||||
if (!test->client)
|
if (!test->client)
|
||||||
goto error;
|
return -1;
|
||||||
|
|
||||||
if (test->outgoingLength > 0)
|
if (test->outgoingLength > 0)
|
||||||
events = VIR_EVENT_HANDLE_WRITABLE;
|
events = VIR_EVENT_HANDLE_WRITABLE;
|
||||||
@ -1113,7 +1111,7 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test)
|
|||||||
qemuMonitorTestIO,
|
qemuMonitorTestIO,
|
||||||
test,
|
test,
|
||||||
NULL) < 0)
|
NULL) < 0)
|
||||||
goto error;
|
return -1;
|
||||||
|
|
||||||
virMutexLock(&test->lock);
|
virMutexLock(&test->lock);
|
||||||
if (virThreadCreate(&test->thread,
|
if (virThreadCreate(&test->thread,
|
||||||
@ -1121,15 +1119,12 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test)
|
|||||||
qemuMonitorTestWorker,
|
qemuMonitorTestWorker,
|
||||||
test) < 0) {
|
test) < 0) {
|
||||||
virMutexUnlock(&test->lock);
|
virMutexUnlock(&test->lock);
|
||||||
goto error;
|
return -1;
|
||||||
}
|
}
|
||||||
test->started = test->running = true;
|
test->started = test->running = true;
|
||||||
virMutexUnlock(&test->lock);
|
virMutexUnlock(&test->lock);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -449,10 +449,9 @@ testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps,
|
|||||||
{
|
{
|
||||||
virGICCapability *gicCapabilities = NULL;
|
virGICCapability *gicCapabilities = NULL;
|
||||||
size_t ngicCapabilities = 0;
|
size_t ngicCapabilities = 0;
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
if (VIR_ALLOC_N(gicCapabilities, 2) < 0)
|
if (VIR_ALLOC_N(gicCapabilities, 2) < 0)
|
||||||
goto out;
|
return -1;
|
||||||
|
|
||||||
# define IMPL_BOTH \
|
# define IMPL_BOTH \
|
||||||
VIR_GIC_IMPLEMENTATION_KERNEL|VIR_GIC_IMPLEMENTATION_EMULATED
|
VIR_GIC_IMPLEMENTATION_KERNEL|VIR_GIC_IMPLEMENTATION_EMULATED
|
||||||
@ -473,10 +472,7 @@ testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps,
|
|||||||
virQEMUCapsSetGICCapabilities(qemuCaps,
|
virQEMUCapsSetGICCapabilities(qemuCaps,
|
||||||
gicCapabilities, ngicCapabilities);
|
gicCapabilities, ngicCapabilities);
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
|
|
||||||
out:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -539,8 +539,6 @@ testVirHostdevOther(const void *opaque G_GNUC_UNUSED)
|
|||||||
static int
|
static int
|
||||||
testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED)
|
testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
/* Don't rely on a state that previous test cases might have
|
/* Don't rely on a state that previous test cases might have
|
||||||
* left the manager in. Start with a clean slate. */
|
* left the manager in. Start with a clean slate. */
|
||||||
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
|
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
|
||||||
@ -552,7 +550,7 @@ testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED)
|
|||||||
|
|
||||||
/* Firstly, attach all NVMe disks */
|
/* Firstly, attach all NVMe disks */
|
||||||
if (virHostdevPrepareNVMeDevices(mgr, drv_name, dom_name, disks, ndisks) < 0)
|
if (virHostdevPrepareNVMeDevices(mgr, drv_name, dom_name, disks, ndisks) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 3);
|
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 3);
|
||||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 2);
|
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. */
|
/* Now, try to detach the first one. */
|
||||||
if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, disks, 1) < 0)
|
if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, disks, 1) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 2);
|
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 2);
|
||||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 2);
|
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 2);
|
||||||
@ -568,7 +566,7 @@ testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED)
|
|||||||
|
|
||||||
/* And the last one */
|
/* And the last one */
|
||||||
if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, &disks[2], 1) < 0)
|
if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, &disks[2], 1) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 1);
|
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 1);
|
||||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 1);
|
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 1);
|
||||||
@ -576,15 +574,13 @@ testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED)
|
|||||||
|
|
||||||
/* Finally, detach the middle one */
|
/* Finally, detach the middle one */
|
||||||
if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, &disks[1], 1) < 0)
|
if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, &disks[1], 1) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 0);
|
CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 0);
|
||||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 0);
|
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 0);
|
||||||
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, 0);
|
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, 0);
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user