if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
hostdevs, nhostdevs, 0) < 0)
goto cleanup;
- CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 + 3);
- CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2 - 3);
+ CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 + nhostdevs);
+ CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2 - nhostdevs);
/* Test conflict */
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
VIR_DEBUG("Test >=1 unmanaged hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
hostdevs, nhostdevs, NULL);
- CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - 3);
- CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2 + 3);
+ CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - nhostdevs);
+ CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2 + nhostdevs);
ret = 0;
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
hostdevs, nhostdevs, 0) < 0)
goto cleanup;
- CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 + 3);
+ CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 + nhostdevs);
/* Test conflict */
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
VIR_DEBUG("Test >=1 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
hostdevs, nhostdevs, NULL);
- CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - 3);
+ CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - nhostdevs);
ret = 0;
if (virHostdevUpdateActivePCIDevices(mgr, hostdevs, nhostdevs,
drv_name, dom_name) < 0)
goto cleanup;
- CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 + 3);
+ CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 + nhostdevs);
ret = 0;