libxc: remove \n from strings passed to PERROR
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 28 May 2010 08:38:18 +0000 (09:38 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 28 May 2010 08:38:18 +0000 (09:38 +0100)
Previously, the code was inconsistent: some calls to PERROR passed \n
and some did not.  With the new logging arrangements, passing \n is
definitely incorrect.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxc/ia64/xc_ia64_hvm_build.c
tools/libxc/ia64/xc_ia64_linux_restore.c
tools/libxc/xc_domain.c
tools/libxc/xc_domain_restore.c
tools/libxc/xc_domain_save.c
tools/libxc/xc_hvm_build.c
tools/libxc/xc_misc.c
tools/libxc/xc_resume.c
tools/libxc/xc_solaris.c

index d3d02aad7cfa0bc4bea5e2478e8b124a7d2ca0a9..3f5f929d9c3395a13dc25ac193300d0eeec7b6ea 100644 (file)
@@ -586,7 +586,7 @@ static int is_valid_address(void *addr)
     if ( p->signature == NVRAM_VALID_SIG )
         return 1;
     else {
-        PERROR("Invalid nvram signature. Nvram save failed!\n");
+        PERROR("Invalid nvram signature. Nvram save failed!");
         return 0;
     }
 }
@@ -613,7 +613,7 @@ copy_from_GFW_to_nvram(xc_interface *xc_handle, uint32_t dom, int nvram_fd)
     pfn_list = (xen_pfn_t *)malloc(sizeof(xen_pfn_t) * nr_pages);
     if ( NULL == pfn_list )
     {
-        PERROR("Cannot allocate memory for nvram save!\n");
+        PERROR("Cannot allocate memory for nvram save!");
         close(nvram_fd);
         return -1;
     }
@@ -630,7 +630,7 @@ copy_from_GFW_to_nvram(xc_interface *xc_handle, uint32_t dom, int nvram_fd)
 
     if ( NULL == tmp_ptr )
     {
-        PERROR("Cannot get nvram data from GFW!\n");
+        PERROR("Cannot get nvram data from GFW!");
         free(pfn_list);
         close(nvram_fd);
         return -1;
@@ -659,7 +659,7 @@ copy_from_GFW_to_nvram(xc_interface *xc_handle, uint32_t dom, int nvram_fd)
                                            pfn_list, nr_pages);
     if ( NULL == tmp_ptr )
     {
-        PERROR("Cannot get nvram data from GFW!\n");
+        PERROR("Cannot get nvram data from GFW!");
         free(pfn_list);
         close(nvram_fd);
         return -1;
@@ -675,7 +675,7 @@ copy_from_GFW_to_nvram(xc_interface *xc_handle, uint32_t dom, int nvram_fd)
     lseek(nvram_fd, 0, SEEK_SET);
     if ( write(nvram_fd, buf, NVRAM_SIZE) != NVRAM_SIZE )
     {
-        PERROR("Save to nvram fail!\n");
+        PERROR("Save to nvram fail!");
         return -1;
     }
 
@@ -703,7 +703,7 @@ int xc_ia64_save_to_nvram(xc_interface *xc_handle, uint32_t dom)
     xc_get_hvm_param(xc_handle, dom, HVM_PARAM_NVRAM_FD, &nvram_fd);
 
     if ( !IS_VALID_NVRAM_FD(nvram_fd) )
-        PERROR("Nvram not initialized. Nvram save failed!\n");
+        PERROR("Nvram not initialized. Nvram save failed!");
     else
         copy_from_GFW_to_nvram(xc_handle, dom, (int)nvram_fd); 
 
@@ -744,7 +744,7 @@ int xc_ia64_nvram_init(xc_interface *xc_handle, char *dom_name, uint32_t dom)
     if ( strlen(nvram_path) + strlen(NVRAM_FILE_PREFIX) +
          strlen(dom_name) + 1 > sizeof(nvram_path) )
     {
-        PERROR("Nvram file path is too long!\n");
+        PERROR("Nvram file path is too long!");
         return -1;
     }
     strcat(nvram_path, NVRAM_FILE_PREFIX);
@@ -800,7 +800,7 @@ xc_ia64_setup_memmap_info(xc_interface *xc_handle, uint32_t dom,
                                        PROT_READ | PROT_WRITE,
                                        memmap_info_pfn);
     if (memmap_info == NULL) {
-        PERROR("Could not map memmmap_info page.\n");
+        PERROR("Could not map memmmap_info page.");
         return -1;
     }
     memset(memmap_info, 0, PAGE_SIZE * memmap_info_num_pages);
@@ -925,7 +925,7 @@ setup_guest(xc_interface *xc_handle, uint32_t dom, unsigned long memsize,
 
     pfn_list = malloc(nr_pages * sizeof(xen_pfn_t));
     if (pfn_list == NULL) {
-        PERROR("Could not allocate memory.\n");
+        PERROR("Could not allocate memory.");
         return -1;
     }
 
@@ -952,7 +952,7 @@ setup_guest(xc_interface *xc_handle, uint32_t dom, unsigned long memsize,
     rc = xc_domain_memory_populate_physmap(xc_handle, dom, nr_pages, 0, 0,
                                            &pfn_list[0]);
     if (rc != 0) {
-        PERROR("Could not allocate normal memory for Vti guest.\n");
+        PERROR("Could not allocate normal memory for Vti guest.");
         goto error_out;
     }
 
@@ -965,7 +965,7 @@ setup_guest(xc_interface *xc_handle, uint32_t dom, unsigned long memsize,
     rc = xc_domain_memory_populate_physmap(xc_handle, dom, GFW_PAGES,
                                            0, 0, &pfn_list[0]);
     if (rc != 0) {
-        PERROR("Could not allocate GFW memory for Vti guest.\n");
+        PERROR("Could not allocate GFW memory for Vti guest.");
         goto error_out;
     }
 
@@ -981,7 +981,7 @@ setup_guest(xc_interface *xc_handle, uint32_t dom, unsigned long memsize,
     rc = xc_domain_memory_populate_physmap(xc_handle, dom, nr_special_pages,
                                            0, 0, &pfn_list[0]);
     if (rc != 0) {
-        PERROR("Could not allocate IO page or store page or buffer io page.\n");
+        PERROR("Could not allocate IO page or store page or buffer io page.");
         goto error_out;
     }
 
@@ -1013,13 +1013,13 @@ setup_guest(xc_interface *xc_handle, uint32_t dom, unsigned long memsize,
     if (xc_ia64_setup_memmap_info(xc_handle, dom, dom_memsize,
                                   pfn_list, nr_special_pages,
                                   memmap_info_pfn, memmap_info_num_pages)) {
-        PERROR("Could not build memmap info\n");
+        PERROR("Could not build memmap info");
         goto error_out;
     }
     if (xc_ia64_setup_shared_info(xc_handle, dom,
                                   domctl.u.getdomaininfo.shared_info_frame,
                                   memmap_info_pfn, memmap_info_num_pages)) {
-        PERROR("Could not setup shared_info\n");
+        PERROR("Could not setup shared_info");
         goto error_out;
     }
 
@@ -1035,7 +1035,7 @@ setup_guest(xc_interface *xc_handle, uint32_t dom, unsigned long memsize,
 
     // Hand-off state passed to guest firmware 
     if (xc_ia64_build_hob(xc_handle, dom, dom_memsize, vcpus, nvram_start) < 0) {
-        PERROR("Could not build hob\n");
+        PERROR("Could not build hob");
         goto error_out;
     }
 
index 68a38738acdf9934d35b98d8bad5ce9bd6001fb1..d52e6c449f56c52547d81707adb750989ef2bd42 100644 (file)
@@ -534,7 +534,7 @@ xc_ia64_hvm_domain_setup(xc_interface *xc_handle, uint32_t dom)
     rc = xc_domain_memory_populate_physmap(xc_handle, dom, nr_pages,
                                            0, 0, &pfn_list[0]);
     if (rc != 0)
-        PERROR("Could not allocate IO page or buffer io page.\n");
+        PERROR("Could not allocate IO page or buffer io page.");
     return rc;
 }
 
index c575eff8318653013973856a104cda04a8a0e7c5..ae323fe8546bea95bb8e37736d511da22d557cc6 100644 (file)
@@ -948,7 +948,7 @@ int xc_get_device_group(
 
     if ( lock_pages(sdev_array, max_sdevs * sizeof(*sdev_array)) != 0 )
     {
-        PERROR("Could not lock memory for xc_get_device_group\n");
+        PERROR("Could not lock memory for xc_get_device_group");
         return -ENOMEM;
     }
     rc = do_domctl(xch, &domctl);
index 4804a61b5a16e4b12f8bb5592bc705172c055429..4f68948d483282372d95ae301c99fd47d99c3fb8 100644 (file)
@@ -124,7 +124,7 @@ static int break_super_page(xc_interface *xch,
 
     if ( ram_base == NULL )
     {
-        PERROR("map batch failed\n");
+        PERROR("map batch failed");
         rc = 1;
         goto out;
     }
@@ -136,7 +136,7 @@ static int break_super_page(xc_interface *xch,
     if ( xc_domain_memory_decrease_reservation(xch, dom, 1,
                                    SUPERPAGE_PFN_SHIFT, &start_pfn) != 0 )
     {
-        PERROR("free 2M page failure @ 0x%ld.\n", next_pfn);
+        PERROR("free 2M page failure @ 0x%ld.", next_pfn);
         rc = 1;
         goto out;
     }
@@ -153,7 +153,7 @@ static int break_super_page(xc_interface *xch,
         if (xc_domain_memory_populate_physmap(xch, dom, 1, 0,
                                               0, &mfn) != 0)
         {
-            PERROR("Failed to allocate physical memory.!\n");
+            PERROR("Failed to allocate physical memory.!");
             errno = ENOMEM;
             rc = 1;
             goto out;
@@ -171,7 +171,7 @@ static int break_super_page(xc_interface *xch,
                                     page_array, tot_pfns);
     if ( ram_base == NULL )
     {
-        PERROR("map batch failed\n");
+        PERROR("map batch failed");
         rc = 1;
         goto out;
     }
@@ -283,7 +283,7 @@ normal_page:
             if (xc_domain_memory_populate_physmap(xch, dom, 1, 0,
                         0, &mfn) != 0)
             {
-                PERROR("Failed to allocate physical memory.! pfn=0x%lx, mfn=0x%lx.\n",
+                PERROR("Failed to allocate physical memory.! pfn=0x%lx, mfn=0x%lx.",
                         pfn, mfn);
                 errno = ENOMEM;
                 return 1;
@@ -1497,7 +1497,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
         if ( !completed ) {
             pagebuf.nr_physpages = pagebuf.nr_pages = 0;
             if ( pagebuf_get_one(xch, &pagebuf, io_fd, dom) < 0 ) {
-                PERROR("Error when reading batch\n");
+                PERROR("Error when reading batch");
                 goto out;
             }
         }
@@ -1929,7 +1929,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
         frc = xc_domctl(xch, &domctl);
         if ( frc != 0 )
         {
-            PERROR("Couldn't set extended vcpu%d info\n", i);
+            PERROR("Couldn't set extended vcpu%d info", i);
             goto out;
         }
     }
index 624b17cb016bfd2dbe002e4b98e184b0487cbb14..2cc8a8cf2349ad12a94ca9b2e71780e5ee1f4974 100644 (file)
@@ -1625,7 +1625,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
         
         if ( wrexact(io_fd, hvm_buf, rec_size) )
         {
-            PERROR("write HVM info failed!\n");
+            PERROR("write HVM info failed!");
             goto out;
         }
         
@@ -1785,7 +1785,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
 
     /* Flush last write and discard cache for file. */
     if ( outbuf_flush(xch, &ob, io_fd) < 0 ) {
-        PERROR("Error when flushing output buffer\n");
+        PERROR("Error when flushing output buffer");
         rc = 1;
     }
 
index 82cbf1f9acbfeadbc6343bc4bbdbab97e77d2cdc..7fe666d5095810cb51d1b999e21f84ab3ac0cd37 100644 (file)
@@ -152,13 +152,13 @@ static int setup_guest(xc_interface *xch,
 
     if ( xc_version(xch, XENVER_capabilities, &caps) != 0 )
     {
-        PERROR("Could not get Xen capabilities\n");
+        PERROR("Could not get Xen capabilities");
         goto error_out;
     }
 
     if ( (elf.pstart & (PAGE_SIZE - 1)) != 0 )
     {
-        PERROR("Guest OS must load to a page boundary.\n");
+        PERROR("Guest OS must load to a page boundary.");
         goto error_out;
     }
 
@@ -172,7 +172,7 @@ static int setup_guest(xc_interface *xch,
 
     if ( (page_array = malloc(nr_pages * sizeof(xen_pfn_t))) == NULL )
     {
-        PERROR("Could not allocate memory.\n");
+        PERROR("Could not allocate memory.");
         goto error_out;
     }
 
@@ -317,7 +317,7 @@ static int setup_guest(xc_interface *xch,
 
     if ( rc != 0 )
     {
-        PERROR("Could not allocate memory for HVM guest.\n");
+        PERROR("Could not allocate memory for HVM guest.");
         goto error_out;
     }
 
@@ -362,7 +362,7 @@ static int setup_guest(xc_interface *xch,
         rc = xc_domain_memory_populate_physmap(xch, dom, 1, 0, 0, &pfn);
         if ( rc != 0 )
         {
-            PERROR("Could not allocate %d'th special page.\n", i);
+            PERROR("Could not allocate %d'th special page.", i);
             goto error_out;
         }
         if ( xc_clear_domain_page(xch, dom, special_pfn(i)) )
index 5ec379589b75aed3b78ca572d6f1c1a9251a5657..82d96d3691983ee6f869288a9bcbe5c7827e3865 100644 (file)
@@ -142,7 +142,7 @@ int xc_mca_op(xc_interface *xch, struct xen_mc *mc)
     mc->interface_version = XEN_MCA_INTERFACE_VERSION;
     if ( lock_pages(mc, sizeof(mc)) )
     {
-        PERROR("Could not lock xen_mc memory\n");
+        PERROR("Could not lock xen_mc memory");
         return -EINVAL;
     }
 
index de93f412b936aa74c4ba276449959649e15a0fcb..7f85e3f6d8acbe9da7df5a2826a16c56878fe3b2 100644 (file)
@@ -47,7 +47,7 @@ static int modify_returncode(xc_interface *xch, uint32_t domid)
         /* HVM guests have host address width. */
         if ( xc_version(xch, XENVER_capabilities, &caps) != 0 )
         {
-            PERROR("Could not get Xen capabilities\n");
+            PERROR("Could not get Xen capabilities");
             return -1;
         }
         dinfo->guest_width = strstr(caps, "x86_64") ? 8 : 4;
index b4830dec1905c2a383f93f092a43f624186f1038..53ec642a8b5f464c85f5dd6985ae4d20475b7f82 100644 (file)
@@ -139,7 +139,7 @@ void *xc_map_foreign_ranges(xc_interface *xch, uint32_t dom,
 ioctl_failed:
     rc = munmap(addr, size);
     if (rc == -1)
-        PERROR("%s: error in error path\n", __FUNCTION__);
+        PERROR("%s: error in error path", __FUNCTION__);
 
 mmap_failed:
     return NULL;