[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [IA64] Fix xen/ia64 save/restore error recovery path.
# HG changeset patch # User Alex Williamson <alex.williamson@xxxxxx> # Date 1179718128 21600 # Node ID bf6f94206fec9a247eed02dc3a031fc9129883bb # Parent 24463758319baf906284c8cd00aae616c8abb0da [IA64] Fix xen/ia64 save/restore error recovery path. Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx> --- tools/libxc/ia64/xc_ia64_linux_restore.c | 8 +++++++- tools/libxc/ia64/xc_ia64_linux_save.c | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff -r 24463758319b -r bf6f94206fec tools/libxc/ia64/xc_ia64_linux_restore.c --- a/tools/libxc/ia64/xc_ia64_linux_restore.c Sun May 20 21:23:35 2007 -0600 +++ b/tools/libxc/ia64/xc_ia64_linux_restore.c Sun May 20 21:28:48 2007 -0600 @@ -48,10 +48,11 @@ read_page(int xc_handle, int io_fd, uint 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_ } 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_ /* 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; diff -r 24463758319b -r bf6f94206fec tools/libxc/ia64/xc_ia64_linux_save.c --- a/tools/libxc/ia64/xc_ia64_linux_save.c Sun May 20 21:23:35 2007 -0600 +++ b/tools/libxc/ia64/xc_ia64_linux_save.c Sun May 20 21:28:48 2007 -0600 @@ -361,11 +361,13 @@ xc_domain_save(int xc_handle, int io_fd, 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, } 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); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |