mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-23 06:23:10 +00:00
virhostdevtest: Check for integer retval in more verbose way
There are few functions called from the test which return an integer but their retval is compared as if it was a pointer. Now, there is nothing wrong with that from machine POV, but from readability perspective it's wrong. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
76dcc854f9
commit
9409f6b724
@ -161,22 +161,22 @@ testVirHostdevPreparePCIHostdevs_unmanaged(void)
|
|||||||
active_count = virPCIDeviceListCount(mgr->activePCIHostdevs);
|
active_count = virPCIDeviceListCount(mgr->activePCIHostdevs);
|
||||||
inactive_count = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
|
inactive_count = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
|
||||||
VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
|
VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
|
||||||
if (!virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
|
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
|
||||||
&hostdevs[0], 1, 0))
|
&hostdevs[0], 1, 0) == 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
||||||
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
||||||
|
|
||||||
VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
|
VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
|
||||||
if (!virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
|
if (virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
|
||||||
&hostdevs[1], 1, 0))
|
&hostdevs[1], 1, 0) == 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
||||||
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
||||||
|
|
||||||
VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
|
VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
|
||||||
if (!virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
|
if (virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
|
||||||
&hostdevs[2], 1, 0))
|
&hostdevs[2], 1, 0) == 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
||||||
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
||||||
@ -252,22 +252,22 @@ testVirHostdevPreparePCIHostdevs_managed(bool mixed)
|
|||||||
active_count = virPCIDeviceListCount(mgr->activePCIHostdevs);
|
active_count = virPCIDeviceListCount(mgr->activePCIHostdevs);
|
||||||
inactive_count = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
|
inactive_count = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
|
||||||
VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
|
VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
|
||||||
if (!virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
|
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
|
||||||
&hostdevs[0], 1, 0))
|
&hostdevs[0], 1, 0) == 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
||||||
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
||||||
|
|
||||||
VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
|
VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
|
||||||
if (!virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
|
if (virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
|
||||||
&hostdevs[1], 1, 0))
|
&hostdevs[1], 1, 0) == 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
||||||
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
||||||
|
|
||||||
VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
|
VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
|
||||||
if (!virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
|
if (virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
|
||||||
&hostdevs[2], 1, 0))
|
&hostdevs[2], 1, 0) == 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, active_count);
|
||||||
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, inactive_count);
|
||||||
|
Loading…
Reference in New Issue
Block a user