[IA64] Fix xen/ia64 save/restore error recovery path.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
This commit is contained in:
Alex Williamson committed 2007-05-20 21:28:48 -06:00
1 parent fc073c9c01
commit 00eb2b2ff1
2 files changed
+10 -1

No files matched your search

+7 -1
View File
@@ -48,10 +48,11 @@ read_page(int xc_handle, int io_fd, uint32_t dom, unsigned long pfn)
PROT_READ|PROT_WRITE, pfn);
if (mem == NULL) {
ERROR("cannot map page");
return -1;
return -1;
}
if (!read_exact(io_fd, mem, PAGE_SIZE)) {
ERROR("Error when reading from state file (5)");
munmap(mem, PAGE_SIZE);
return -1;
}
munmap(mem, PAGE_SIZE);
@@ -270,6 +271,7 @@ xc_domain_restore(int xc_handle, int io_fd, uint32_t dom,
}
if (!read_exact(io_fd, shared_info, PAGE_SIZE)) {
ERROR("Error when reading shared_info page");
munmap(shared_info, PAGE_SIZE);
goto out;
}
@@ -286,6 +288,10 @@ xc_domain_restore(int xc_handle, int io_fd, uint32_t dom,
/* Uncanonicalise the suspend-record frame number and poke resume rec. */
start_info = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
PROT_READ | PROT_WRITE, gmfn);
if (start_info == NULL) {
ERROR("cannot map start_info page");
goto out;
}
start_info->nr_pages = p2m_size;
start_info->shared_info = shared_info_frame << PAGE_SHIFT;
start_info->flags = 0;
+3
View File
@@ -361,11 +361,13 @@ xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
if (!write_exact(io_fd, &N, sizeof(N))) {
ERROR("write: max_pfn");
munmap(mem, PAGE_SIZE);
goto out;
}
if (write(io_fd, mem, PAGE_SIZE) != PAGE_SIZE) {
ERROR("Error when writing to state file (5)");
munmap(mem, PAGE_SIZE);
goto out;
}
munmap(mem, PAGE_SIZE);
@@ -470,6 +472,7 @@ xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
}
if (write(io_fd, mem, PAGE_SIZE) != PAGE_SIZE) {
ERROR("Error when writing privreg to state file (5)");
munmap(mem, PAGE_SIZE);
goto out;
}
munmap(mem, PAGE_SIZE);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.