libxl: fix places missed by spatch
authorWei Liu <wei.liu2@citrix.com>
Fri, 2 Oct 2015 14:56:41 +0000 (15:56 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 7 Oct 2015 11:30:36 +0000 (12:30 +0100)
The spatch provided in previous patch didn't handle all sites that need
transformation.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_create.c
tools/libxl/libxl_pci.c
tools/libxl/libxl_x86.c

index ca725a91e1aab6f4d622d20e7e18a30d531aa0d4..22bbc2947e851d7f201ac21a4fb79720aa19884e 100644 (file)
@@ -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");
index 30380ecb584d4e330d44d10997ad88f1369083ea..f0fee007c8e7e0623b896a60e851c34c35c520e0 100644 (file)
@@ -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 {
index 378f6b02dde303e9af52b430d63acb59c3dd6174..fad2eb6833ae0b49b2b74595eac6b3af8d739b7b 100644 (file)
@@ -768,7 +768,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;
     int rc;
@@ -793,16 +792,14 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
         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;
     }
 
@@ -812,13 +809,11 @@ static int libxl__device_pci_assignable_add(libxl__gc *gc,
             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);
@@ -906,7 +901,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;
 
@@ -935,8 +929,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);
@@ -1134,7 +1128,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;
 
@@ -1160,7 +1153,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);
     }
@@ -1214,11 +1209,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;
         }
     }
@@ -1233,8 +1228,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;
     }
index a3e50df0556f7d4bbe1f5c05ce4fc9b71d7a98a0..bedd9418ff56e0ed4bd72f268e56fbdd513b768d 100644 (file)
@@ -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