handle = pcap_open_live(listen_if, BUFSIZ, 0, PKT_TIMEOUT_MS, errbuf);
if (handle == NULL) {
- VIR_DEBUG("Couldn't open device %s: %s\n", listen_if, errbuf);
+ VIR_DEBUG("Couldn't open device %s: %s", listen_if, errbuf);
req->status = ENODEV;
goto done;
}
filter = virBufferContentAndReset(&buf);
if (pcap_compile(handle, &fp, filter, 1, 0) != 0) {
- VIR_DEBUG("Couldn't compile filter '%s'.\n", filter);
+ VIR_DEBUG("Couldn't compile filter '%s'", filter);
req->status = EINVAL;
goto done;
}
if (pcap_setfilter(handle, &fp) != 0) {
- VIR_DEBUG("Couldn't set filter '%s'.\n", filter);
+ VIR_DEBUG("Couldn't set filter '%s'", filter);
req->status = EINVAL;
pcap_freecode(&fp);
goto done;
req->filtername,
req->filterparams);
VIR_DEBUG("Result from applying firewall rules on "
- "%s with IP addr %s : %d\n", req->ifname, inetaddr, ret);
+ "%s with IP addr %s : %d", req->ifname, inetaddr, ret);
}
} else {
if (showError)
techdriver->applyDropAllRules(req->ifname);
}
- VIR_DEBUG("pcap thread terminating for interface %s\n", req->ifname);
+ VIR_DEBUG("pcap thread terminating for interface %s", req->ifname);
virNWFilterUnlockIface(req->ifname);
case RTM_DELLINK:
case RTM_SETLINK:
case RTM_GETLINK:
- VIR_DEBUG(" IFINFOMSG\n");
- VIR_DEBUG(" ifi_family = 0x%02x\n",
+ VIR_DEBUG(" IFINFOMSG");
+ VIR_DEBUG(" ifi_family = 0x%02x",
((struct ifinfomsg *)data)->ifi_family);
- VIR_DEBUG(" ifi_type = 0x%x\n",
+ VIR_DEBUG(" ifi_type = 0x%x",
((struct ifinfomsg *)data)->ifi_type);
- VIR_DEBUG(" ifi_index = %i\n",
+ VIR_DEBUG(" ifi_index = %i",
((struct ifinfomsg *)data)->ifi_index);
- VIR_DEBUG(" ifi_flags = 0x%04x\n",
+ VIR_DEBUG(" ifi_flags = 0x%04x",
((struct ifinfomsg *)data)->ifi_flags);
- VIR_DEBUG(" ifi_change = 0x%04x\n",
+ VIR_DEBUG(" ifi_change = 0x%04x",
((struct ifinfomsg *)data)->ifi_change);
}
/* DEBUG end */
if (tb[IFLA_IFNAME]) {
ifname = (char *)RTA_DATA(tb[IFLA_IFNAME]);
- VIR_DEBUG("IFLA_IFNAME = %s\n", ifname);
+ VIR_DEBUG("IFLA_IFNAME = %s", ifname);
}
if (tb[IFLA_OPERSTATE]) {
rem = *(unsigned short *)RTA_DATA(tb[IFLA_OPERSTATE]);
- VIR_DEBUG("IFLA_OPERSTATE = %d\n", rem);
+ VIR_DEBUG("IFLA_OPERSTATE = %d", rem);
}
if (tb[IFLA_VF_PORTS]) {
struct nlattr *tb_vf_ports;
- VIR_DEBUG("found IFLA_VF_PORTS\n");
+ VIR_DEBUG("found IFLA_VF_PORTS");
nla_for_each_nested(tb_vf_ports, tb[IFLA_VF_PORTS], rem) {
- VIR_DEBUG("iterating\n");
+ VIR_DEBUG("iterating");
if (nla_type(tb_vf_ports) != IFLA_VF_PORT) {
- VIR_DEBUG("not a IFLA_VF_PORT. skipping\n");
+ VIR_DEBUG("not a IFLA_VF_PORT. skipping");
continue;
}
if (nla_parse_nested(tb3, IFLA_PORT_MAX, tb_vf_ports,
uuid = (unsigned char *)
RTA_DATA(tb3[IFLA_PORT_INSTANCE_UUID]);
instance2str(uuid, instance, sizeof(instance));
- VIR_DEBUG("IFLA_PORT_INSTANCE_UUID = %s\n",
+ VIR_DEBUG("IFLA_PORT_INSTANCE_UUID = %s",
instance);
}
}
if (tb3[IFLA_PORT_RESPONSE]) {
- VIR_DEBUG("IFLA_PORT_RESPONSE = %d\n", *(uint16_t *)
+ VIR_DEBUG("IFLA_PORT_RESPONSE = %d", *(uint16_t *)
RTA_DATA(tb3[IFLA_PORT_RESPONSE]));
}
}
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
/* Test normal functionality */
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
NULL, 0, 0) < 0)
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
/* Test unmanaged hostdevs */
- VIR_DEBUG("Test >=1 unmanaged hostdevs\n");
+ VIR_DEBUG("Test >=1 unmanaged hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
hostdevs, nhostdevs, 0) < 0)
goto cleanup;
/* Test conflict */
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
- VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
&hostdevs[0], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2);
- VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
&hostdevs[1], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
CHECK_LIST_COUNT(mgr->inactivePCIHostdevs, count2);
- VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
&hostdevs[2], 1, 0))
goto cleanup;
for (i = 0; i < nhostdevs; i++) {
if (hostdevs[i]->managed != false) {
- VIR_DEBUG("invalid test\n");
+ VIR_DEBUG("invalid test");
return -1;
}
}
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
count2 = virPCIDeviceListCount(mgr->inactivePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name, NULL, 0, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 unmanaged hostdevs\n");
+ VIR_DEBUG("Test >=1 unmanaged hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
hostdevs, nhostdevs, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - 3);
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
/* Test normal functionality */
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
if (virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
hostdevs, nhostdevs, 0) < 0)
goto cleanup;
/* Test conflict */
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, dom_name, uuid,
&hostdevs[0], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for same driver, diff domain again");
if (!virHostdevPreparePCIDevices(mgr, drv_name, "test_domain1", uuid,
&hostdevs[1], 1, 0))
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again\n");
+ VIR_DEBUG("Test: prepare same hostdevs for diff driver/domain again");
if (!virHostdevPreparePCIDevices(mgr, "test_driver1", dom_name, uuid,
&hostdevs[2], 1, 0))
goto cleanup;
for (i = 0; i < nhostdevs; i++) {
if (hostdevs[i]->managed != true) {
- VIR_DEBUG("invalid test\n");
+ VIR_DEBUG("invalid test");
return -1;
}
}
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name, NULL, 0, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
virHostdevReAttachPCIDevices(mgr, drv_name, dom_name,
hostdevs, nhostdevs, NULL);
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1 - 3);
count1 = virPCIDeviceListCount(mgr->activePCIHostdevs);
- VIR_DEBUG("Test 0 hostdevs\n");
+ VIR_DEBUG("Test 0 hostdevs");
if (virHostdevUpdateActivePCIDevices(mgr, NULL, 0,
drv_name, dom_name) < 0)
goto cleanup;
CHECK_LIST_COUNT(mgr->activePCIHostdevs, count1);
- VIR_DEBUG("Test >=1 hostdevs\n");
+ VIR_DEBUG("Test >=1 hostdevs");
if (virHostdevUpdateActivePCIDevices(mgr, hostdevs, nhostdevs,
drv_name, dom_name) < 0)
goto cleanup;
# define DO_TEST(fnc) \
do { \
- VIR_DEBUG("\nTesting: %s", #fnc); \
+ VIR_DEBUG("Testing: %s", #fnc); \
if (virtTestRun(#fnc, fnc, NULL) < 0) \
ret = -1; \
} while (0)