[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 4/4] libxl: fix places missed by spatch
The spatch provided in previous patch didn't handle all sites that need transformation. Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- tools/libxl/libxl.c | 17 ++++++++--------- tools/libxl/libxl_create.c | 4 ++-- tools/libxl/libxl_pci.c | 39 ++++++++++++++++++--------------------- tools/libxl/libxl_x86.c | 10 +++++----- 4 files changed, 33 insertions(+), 37 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 9b2047f..3e356fc 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -1221,11 +1221,10 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w, } 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) { @@ -1233,10 +1232,10 @@ static void domain_death_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w, 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"); diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 88cb93c..420358c 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -97,8 +97,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, if (rc < 0) { /* qemu-xen unavailable, use qemu-xen-traditional */ if (errno == ENOENT) { - LIBXL__LOG_ERRNO(CTX, XTL_VERBOSE, "qemu-xen is unavailable" - ", use qemu-xen-traditional instead"); + LOGE(VERBOSE, "qemu-xen is unavailable" + ", use qemu-xen-traditional instead"); b_info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL; } else { diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index ac7d83b..0650ea6 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -635,7 +635,6 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc, libxl_device_pci *pcidev, int rebind) { - libxl_ctx *ctx = libxl__gc_owner(gc); unsigned dom, bus, dev, func; char *spath, *driver_path = NULL; struct stat st; @@ -655,16 +654,15 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc, /* Check to see if it's already assigned to pciback */ if ( pciback_dev_is_assigned(gc, pcidev) ) { - 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; } @@ -673,9 +671,8 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc, if ( driver_path ) { pci_assignable_driver_path_write(gc, pcidev, 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); } } @@ -762,7 +759,6 @@ int libxl_device_pci_assignable_remove(libxl_ctx *ctx, libxl_device_pci *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; @@ -791,8 +787,8 @@ static int pci_multifunction_check(libxl__gc *gc, libxl_device_pci *pcidev, unsi 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); @@ -990,7 +986,6 @@ out: 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; @@ -1016,7 +1011,9 @@ static int libxl__device_pci_reset(libxl__gc *gc, unsigned int domain, unsigned 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); } @@ -1070,11 +1067,11 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide 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; } } @@ -1089,8 +1086,8 @@ int libxl__device_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcide } 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; } diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c index a3e50df..bedd941 100644 --- a/tools/libxl/libxl_x86.c +++ b/tools/libxl/libxl_x86.c @@ -91,11 +91,11 @@ static int e820_sanitize(libxl__gc *gc, struct e820entry src[], ram_end = e820[idx].addr + e820[idx].size; idx ++; - LIBXL__LOG(CTX, LIBXL__LOG_DEBUG, "Memory: %"PRIu64"kB End of RAM: " \ - "0x%"PRIx64" (PFN) Delta: %"PRIu64"kB, PCI start: %"PRIu64"kB " \ - "(0x%"PRIx64" PFN), Balloon %"PRIu64"kB\n", (uint64_t)map_limitkb, - ram_end >> 12, delta_kb, start_kb ,start >> 12, - (uint64_t)balloon_kb); + LOG(DEBUG, "Memory: %"PRIu64"kB End of RAM: " \ + "0x%"PRIx64" (PFN) Delta: %"PRIu64"kB, PCI start: %"PRIu64"kB " \ + "(0x%"PRIx64" PFN), Balloon %"PRIu64"kB\n", (uint64_t)map_limitkb, + ram_end >> 12, delta_kb, start_kb ,start >> 12, + (uint64_t)balloon_kb); /* This whole code below is to guard against if the Intel IGD is passed into -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |