diff options
author | Jim Fehlig <jfehlig@novell.com> | 2011-05-28 09:26:32 +0100 |
---|---|---|
committer | Jim Fehlig <jfehlig@novell.com> | 2011-05-28 09:26:32 +0100 |
commit | 6d4512d84a9a78e865e663d82813f4b4e56dfba1 (patch) | |
tree | 2ed7d8ea32dd33bee8c49523741a56e2acf0831f | |
parent | 3a32c0c37272fc64ccbf7af5f5bdeb838e64de61 (diff) | |
download | xen-6d4512d84a9a78e865e663d82813f4b4e56dfba1.tar.gz xen-6d4512d84a9a78e865e663d82813f4b4e56dfba1.tar.bz2 xen-6d4512d84a9a78e865e663d82813f4b4e56dfba1.zip |
libxc: after saving, unmap correct amount for live_m2p
With some help from Olaf, I've finally got to the bottom of an issue I
came across while trying to implement save/restore in the libvirt
libxenlight driver. After issuing the save operation, the saved
domain was not being cleaned up properly and left in this state from
xl's perspective
xen33:# xl list
Name ID Mem VCPUs State Time(s)
Domain-0 0 6821 8 r----- 122.5
(null) 2 2 2 --pssd 10.8
Checking the libvirtd /proc/$pid/maps I found this
7f3798984000-7f3798b86000 r--s 00002000 00:03 4026532097
/proc/xen/privcmd
So not all all pages belonging to the domain were unmapped from
libvirtd. In tools/libxc/xc_domain_save.c we found that
P2M_FL_ENTRIES were being mapped but only P2M_FLL_ENTRIES were being
unmapped. The attached patch changes the unmapping to use the same
P2M_FL_ENTRIES macro. I'm not too familiar with this code though so
posting here for review.
I suspect this was not noticed before since most (all?) processes
doing save terminate after the save and are not long-running like
libvirtd.
Ian Campbell writes:
> Looks like I introduced this in 18558:ccf0205255e1, sorry!
>
> I guess it is also wrong in the error path out of map_and_save_p2m_table
> and so we also need [another hunk].
This change should be backported to relevant earlier trees. -iwj
From: Jim Fehlig <jfehlig@novell.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 23373:171007b4e2c4
xen-unstable date: Tue May 24 14:50:00 2011 +0100
-rw-r--r-- | tools/libxc/xc_domain_save.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c index cb98374e02..bb65436d1c 100644 --- a/tools/libxc/xc_domain_save.c +++ b/tools/libxc/xc_domain_save.c @@ -820,7 +820,7 @@ static xen_pfn_t *map_and_save_p2m_table(int xc_handle, out: if ( !success && p2m ) - munmap(p2m, P2M_FLL_ENTRIES * PAGE_SIZE); + munmap(p2m, P2M_FL_ENTRIES * PAGE_SIZE); if ( live_p2m_frame_list_list ) munmap(live_p2m_frame_list_list, PAGE_SIZE); @@ -1833,7 +1833,7 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters, munmap(live_shinfo, PAGE_SIZE); if ( ctx->live_p2m ) - munmap(ctx->live_p2m, P2M_FLL_ENTRIES * PAGE_SIZE); + munmap(ctx->live_p2m, P2M_FL_ENTRIES * PAGE_SIZE); if ( ctx->live_m2p ) munmap(ctx->live_m2p, M2P_SIZE(ctx->max_mfn)); |