[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxc: remove \n from strings passed to PERROR
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1275035898 -3600 # Node ID 2531dc129d81c9243433fb2523aa54dad9b4e2ef # Parent dd6bbdc42033af77c0f91808c7f9d924892ecdad libxc: remove \n from strings passed to PERROR 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@xxxxxxxxxxxxx> --- tools/libxc/ia64/xc_ia64_hvm_build.c | 30 +++++++++++++++--------------- tools/libxc/ia64/xc_ia64_linux_restore.c | 2 +- tools/libxc/xc_domain.c | 2 +- tools/libxc/xc_domain_restore.c | 14 +++++++------- tools/libxc/xc_domain_save.c | 4 ++-- tools/libxc/xc_hvm_build.c | 10 +++++----- tools/libxc/xc_misc.c | 2 +- tools/libxc/xc_resume.c | 2 +- tools/libxc/xc_solaris.c | 2 +- 9 files changed, 34 insertions(+), 34 deletions(-) diff -r dd6bbdc42033 -r 2531dc129d81 tools/libxc/ia64/xc_ia64_hvm_build.c --- a/tools/libxc/ia64/xc_ia64_hvm_build.c Fri May 28 09:37:42 2010 +0100 +++ b/tools/libxc/ia64/xc_ia64_hvm_build.c Fri May 28 09:38:18 2010 +0100 @@ -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_ 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_ 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_ 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_ 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_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_ 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 * 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, uin 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, uin 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, uin 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, uin 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, uin 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, uin // 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; } diff -r dd6bbdc42033 -r 2531dc129d81 tools/libxc/ia64/xc_ia64_linux_restore.c --- a/tools/libxc/ia64/xc_ia64_linux_restore.c Fri May 28 09:37:42 2010 +0100 +++ b/tools/libxc/ia64/xc_ia64_linux_restore.c Fri May 28 09:38:18 2010 +0100 @@ -534,7 +534,7 @@ xc_ia64_hvm_domain_setup(xc_interface *x 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; } diff -r dd6bbdc42033 -r 2531dc129d81 tools/libxc/xc_domain.c --- a/tools/libxc/xc_domain.c Fri May 28 09:37:42 2010 +0100 +++ b/tools/libxc/xc_domain.c Fri May 28 09:38:18 2010 +0100 @@ -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); diff -r dd6bbdc42033 -r 2531dc129d81 tools/libxc/xc_domain_restore.c --- a/tools/libxc/xc_domain_restore.c Fri May 28 09:37:42 2010 +0100 +++ b/tools/libxc/xc_domain_restore.c Fri May 28 09:38:18 2010 +0100 @@ -124,7 +124,7 @@ static int break_super_page(xc_interface 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 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 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 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, 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, 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; } } diff -r dd6bbdc42033 -r 2531dc129d81 tools/libxc/xc_domain_save.c --- a/tools/libxc/xc_domain_save.c Fri May 28 09:37:42 2010 +0100 +++ b/tools/libxc/xc_domain_save.c Fri May 28 09:38:18 2010 +0100 @@ -1625,7 +1625,7 @@ int xc_domain_save(xc_interface *xch, in 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, in /* 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; } diff -r dd6bbdc42033 -r 2531dc129d81 tools/libxc/xc_hvm_build.c --- a/tools/libxc/xc_hvm_build.c Fri May 28 09:37:42 2010 +0100 +++ b/tools/libxc/xc_hvm_build.c Fri May 28 09:38:18 2010 +0100 @@ -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)) ) diff -r dd6bbdc42033 -r 2531dc129d81 tools/libxc/xc_misc.c --- a/tools/libxc/xc_misc.c Fri May 28 09:37:42 2010 +0100 +++ b/tools/libxc/xc_misc.c Fri May 28 09:38:18 2010 +0100 @@ -142,7 +142,7 @@ int xc_mca_op(xc_interface *xch, struct 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; } diff -r dd6bbdc42033 -r 2531dc129d81 tools/libxc/xc_resume.c --- a/tools/libxc/xc_resume.c Fri May 28 09:37:42 2010 +0100 +++ b/tools/libxc/xc_resume.c Fri May 28 09:38:18 2010 +0100 @@ -47,7 +47,7 @@ static int modify_returncode(xc_interfac /* 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; diff -r dd6bbdc42033 -r 2531dc129d81 tools/libxc/xc_solaris.c --- a/tools/libxc/xc_solaris.c Fri May 28 09:37:42 2010 +0100 +++ b/tools/libxc/xc_solaris.c Fri May 28 09:38:18 2010 +0100 @@ -139,7 +139,7 @@ ioctl_failed: 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; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |