diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/examples/xc_dom_control.py | 4 | ||||
-rw-r--r-- | tools/xc/lib/xc_linux_save.c | 17 |
2 files changed, 17 insertions, 4 deletions
diff --git a/tools/examples/xc_dom_control.py b/tools/examples/xc_dom_control.py index 877afa53d1..2da4ddaf7b 100755 --- a/tools/examples/xc_dom_control.py +++ b/tools/examples/xc_dom_control.py @@ -136,11 +136,13 @@ elif cmd == 'suspend': pid = int(fd.readline()) os.kill(pid, signal.SIGTERM) + """ xc.domain_stop( dom=dom ) - + XXX while not xc.domain_getinfo( first_dom=dom, max_doms=1 )[0]['stopped']: print "Sleep..." time.sleep(0.001); + """ rc = xc.linux_save( dom=dom, state_file=file, progress=1) if rc == 0 : xc.domain_destroy( dom=dom, force=1 ) diff --git a/tools/xc/lib/xc_linux_save.c b/tools/xc/lib/xc_linux_save.c index ceb5f02e15..64625c53f6 100644 --- a/tools/xc/lib/xc_linux_save.c +++ b/tools/xc/lib/xc_linux_save.c @@ -140,8 +140,9 @@ int xc_linux_save(int xc_handle, /* bitmap of pages left to send */ unsigned long *to_send, *to_fix; -//live=0; - + int needed_to_fix = 0; + int total_sent = 0; + if ( mlock(&ctxt, sizeof(ctxt) ) ) { PERROR("Unable to mlock ctxt"); @@ -422,6 +423,7 @@ int xc_linux_save(int xc_handle, if ( last_iter && test_bit(n, to_fix ) && !test_bit(n, to_send )) { + needed_to_fix++; DPRINTF("Fix! iter %d, pfn %lx. mfn %lx\n", iter,n,pfn_type[batch]); } @@ -567,9 +569,18 @@ int xc_linux_save(int xc_handle, munmap(region_base, batch*PAGE_SIZE); skip: - + + total_sent += sent_this_iter; + verbose_printf("\b\b\b\b100%% (%d pages)\n", sent_this_iter ); + if ( last_iter ) + { + verbose_printf("Total pages sent= %d (%.2fx)\n", + total_sent, ((float)total_sent)/nr_pfns ); + verbose_printf("(of which %d were fixups)\n", needed_to_fix ); + } + if ( debug && last_iter ) { int minusone = -1; |