}
gotend = &domaininfos[rc];
- LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "[evg=%p:%"PRIu32"]"
- " nentries=%d rc=%d %ld..%ld",
- evg, evg->domid, nentries, rc,
- rc>0 ? (long)domaininfos[0].domain : 0,
- rc>0 ? (long)domaininfos[rc-1].domain : 0);
+ LOG(DEBUG, "[evg=%p:%"PRIu32"] nentries=%d rc=%d %ld..%ld",
+ evg, evg->domid, nentries, rc,
+ rc>0 ? (long)domaininfos[0].domain : 0,
+ rc>0 ? (long)domaininfos[rc-1].domain : 0);
for (;;) {
if (!evg) {
goto all_reported;
}
- LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "[evg=%p:%"PRIu32"]"
- " got=domaininfos[%d] got->domain=%ld",
- evg, evg->domid, (int)(got - domaininfos),
- got < gotend ? (long)got->domain : -1L);
+ LOG(DEBUG, "[evg=%p:%"PRIu32"]"
+ " got=domaininfos[%d] got->domain=%ld",
+ evg, evg->domid, (int)(got - domaininfos),
+ got < gotend ? (long)got->domain : -1L);
if (!rc) {
domain_death_occurred(egc, &evg, "empty list");
libxl_device_pci *pcidev,
int rebind)
{
- libxl_ctx *ctx = libxl__gc_owner(gc);
unsigned dom, bus, dev, func;
char *spath, *driver_path = NULL;
int rc;
return ERROR_FAIL;
}
if ( rc ) {
- LIBXL__LOG(ctx, LIBXL__LOG_WARNING, PCI_BDF" already assigned to pciback",
- dom, bus, dev, func);
+ LOG(WARN, PCI_BDF" already assigned to pciback", dom, bus, dev, func);
return 0;
}
/* Check to see if there's already a driver that we need to unbind from */
if ( sysfs_dev_unbind(gc, pcidev, &driver_path ) ) {
- LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
- "Couldn't unbind "PCI_BDF" from driver",
- dom, bus, dev, func);
+ LOG(ERROR, "Couldn't unbind "PCI_BDF" from driver",
+ dom, bus, dev, func);
return ERROR_FAIL;
}
pci_assignable_driver_path_write(gc, pcidev, driver_path);
} else if ( (driver_path =
pci_assignable_driver_path_read(gc, pcidev)) != NULL ) {
- LIBXL__LOG(ctx, LIBXL__LOG_INFO,
- PCI_BDF" not bound to a driver, will be rebound to %s",
- dom, bus, dev, func, driver_path);
+ LOG(INFO, PCI_BDF" not bound to a driver, will be rebound to %s",
+ dom, bus, dev, func, driver_path);
} else {
- LIBXL__LOG(ctx, LIBXL__LOG_WARNING,
- PCI_BDF" not bound to a driver, will not be rebound.",
- dom, bus, dev, func);
+ LOG(WARN, PCI_BDF" not bound to a driver, will not be rebound.",
+ dom, bus, dev, func);
}
} else {
pci_assignable_driver_path_remove(gc, pcidev);
*/
static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsigned int *func_mask)
{
- libxl_ctx *ctx = libxl__gc_owner(gc);
struct dirent *de;
DIR *dir;
path = libxl__sprintf(gc, "%s/" PCI_BDF, SYSFS_PCIBACK_DRIVER, dom, bus, dev, func);
if ( lstat(path, &st) ) {
if ( errno == ENOENT )
- LIBXL__LOG(ctx, LIBXL__LOG_ERROR, PCI_BDF " is not assigned to pciback driver",
- dom, bus, dev, func);
+ LOG(ERROR, PCI_BDF " is not assigned to pciback driver",
+ dom, bus, dev, func);
else
LOGE(ERROR, "Couldn't lstat %s", path);
closedir(dir);
static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned int bus,
unsigned int dev, unsigned int func)
{
- libxl_ctx *ctx = libxl__gc_owner(gc);
char *reset;
int fd, rc;
return rc < 0 ? rc : 0;
}
if (errno == ENOENT) {
- LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "The kernel doesn't support reset from sysfs for PCI device "PCI_BDF, domain, bus, dev, func);
+ LOG(ERROR,
+ "The kernel doesn't support reset from sysfs for PCI device "PCI_BDF,
+ domain, bus, dev, func);
} else {
LOGE(ERROR, "Failed to access reset path %s", reset);
}
if (libxl__domain_type(gc, domid) == LIBXL_DOMAIN_TYPE_HVM) {
rc = xc_test_assign_device(ctx->xch, domid, pcidev_encode_bdf(pcidev));
if (rc) {
- LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
- "PCI device %04x:%02x:%02x.%u %s?",
- pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func,
- errno == ENOSYS ? "cannot be assigned - no IOMMU"
- : "already assigned to a different guest");
+ LOG(ERROR,
+ "PCI device %04x:%02x:%02x.%u %s?",
+ pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func,
+ errno == ENOSYS ? "cannot be assigned - no IOMMU"
+ : "already assigned to a different guest");
goto out;
}
}
}
if (!libxl_pcidev_assignable(ctx, pcidev)) {
- LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "PCI device %x:%x:%x.%x is not assignable",
- pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
+ LOG(ERROR, "PCI device %x:%x:%x.%x is not assignable",
+ pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func);
rc = ERROR_FAIL;
goto out;
}