VIR_LOG_INIT("tests.hostdevtest");
-# define CHECK_LIST_COUNT(list, cnt) \
- if ((count = virPCIDeviceListCount(list)) != cnt) { \
- virReportError(VIR_ERR_INTERNAL_ERROR, \
- "Unexpected count of items in " #list ": %d, " \
- "expecting %zu", count, (size_t) cnt); \
- goto cleanup; \
- }
+# define CHECK_LIST_COUNT(list, cnt) \
+ do { \
+ int actualCount; \
+ if ((actualCount = virPCIDeviceListCount(list)) != cnt) { \
+ virReportError(VIR_ERR_INTERNAL_ERROR, \
+ "Unexpected count of items in " #list ": %d, " \
+ "expecting %zu", actualCount, (size_t) cnt); \
+ goto cleanup; \
+ } \
+ } while (0)
# define TEST_STATE_DIR abs_builddir "/hostdevmgr"
static const char *drv_name = "test_driver";
{
int ret = -1;
size_t i;
- int count, active_count, inactive_count;
+ int active_count, inactive_count;
for (i = 0; i < nhostdevs; i++)
hostdevs[i]->managed = false;
{
int ret = -1;
size_t i;
- int count, active_count, inactive_count;
+ int active_count, inactive_count;
for (i = 0; i < nhostdevs; i++) {
if (hostdevs[i]->managed != false) {
{
int ret = -1;
size_t i;
- int count, active_count;
+ int active_count;
for (i = 0; i < nhostdevs; i++)
hostdevs[i]->managed = true;
{
int ret = -1;
size_t i;
- int count, active_count;
+ int active_count;
for (i = 0; i < nhostdevs; i++) {
if (hostdevs[i]->managed != true) {
{
int ret = -1;
size_t i;
- int count, inactive_count;
+ int inactive_count;
for (i = 0; i < nhostdevs; i++) {
inactive_count = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
{
int ret = -1;
size_t i;
- int count, inactive_count;
+ int inactive_count;
for (i = 0; i < nhostdevs; i++) {
inactive_count = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
testVirHostdevUpdateActivePCIHostdevs(const void *opaque ATTRIBUTE_UNUSED)
{
int ret = -1;
- int count, active_count;
+ int active_count;
active_count = virPCIDeviceListCount(mgr->activePCIHostdevs);