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;
}
}
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;
}
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;
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;
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;
}
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);
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);
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);
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;
}
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;
}
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;
}
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;
}
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;
}
// 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;
}
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;
}
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);
if ( ram_base == NULL )
{
- PERROR("map batch failed\n");
+ PERROR("map batch failed");
rc = 1;
goto out;
}
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;
}
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;
page_array, tot_pfns);
if ( ram_base == NULL )
{
- PERROR("map batch failed\n");
+ PERROR("map batch failed");
rc = 1;
goto out;
}
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;
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;
}
}
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;
}
}
if ( wrexact(io_fd, hvm_buf, rec_size) )
{
- PERROR("write HVM info failed!\n");
+ PERROR("write HVM info failed!");
goto out;
}
/* 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;
}
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;
}
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;
}
if ( rc != 0 )
{
- PERROR("Could not allocate memory for HVM guest.\n");
+ PERROR("Could not allocate memory for HVM guest.");
goto error_out;
}
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)) )
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;
}
/* 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;
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;