diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-09-03 18:38:11 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2010-09-03 18:38:11 +0100 |
commit | 59e3c6a2c6cae1d50ec39ef334c8ab346da1c3b9 (patch) | |
tree | 6b54b13e9d06ce21d8f683f2c80f41f266d3d5cc /tools/libxc/xc_domain_restore.c | |
parent | 47e13da0a1b0c6e22f95eb79585cb1ab1dddec75 (diff) | |
download | xen-59e3c6a2c6cae1d50ec39ef334c8ab346da1c3b9.tar.gz xen-59e3c6a2c6cae1d50ec39ef334c8ab346da1c3b9.tar.bz2 xen-59e3c6a2c6cae1d50ec39ef334c8ab346da1c3b9.zip |
libxc: document save/restore protocol
Reverse engineered from the code, likely contains inaccuracies but I
think provides a base to work from.
Add symbolic names for the minus-flags.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_domain_restore.c')
-rw-r--r-- | tools/libxc/xc_domain_restore.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c index 6541021de1..0d326d4a27 100644 --- a/tools/libxc/xc_domain_restore.c +++ b/tools/libxc/xc_domain_restore.c @@ -683,11 +683,11 @@ static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx, if (!count) { // DPRINTF("Last batch read\n"); return 0; - } else if (count == -1) { + } else if (count == XC_SAVE_ID_ENABLE_VERIFY_MODE) { DPRINTF("Entering page verify mode\n"); buf->verify = 1; return pagebuf_get_one(xch, ctx, buf, fd, dom); - } else if (count == -2) { + } else if (count == XC_SAVE_ID_VCPU_INFO) { buf->new_ctxt_format = 1; if ( RDEXACT(fd, &buf->max_vcpu_id, sizeof(buf->max_vcpu_id)) || buf->max_vcpu_id >= 64 || RDEXACT(fd, &buf->vcpumap, @@ -697,7 +697,7 @@ static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx, } // DPRINTF("Max VCPU ID: %d, vcpumap: %llx\n", buf->max_vcpu_id, buf->vcpumap); return pagebuf_get_one(xch, ctx, buf, fd, dom); - } else if (count == -3) { + } else if (count == XC_SAVE_ID_HVM_IDENT_PT) { /* Skip padding 4 bytes then read the EPT identity PT location. */ if ( RDEXACT(fd, &buf->identpt, sizeof(uint32_t)) || RDEXACT(fd, &buf->identpt, sizeof(uint64_t)) ) @@ -707,7 +707,7 @@ static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx, } // DPRINTF("EPT identity map address: %llx\n", buf->identpt); return pagebuf_get_one(xch, ctx, buf, fd, dom); - } else if ( count == -4 ) { + } else if ( count == XC_SAVE_ID_HVM_VM86_TSS ) { /* Skip padding 4 bytes then read the vm86 TSS location. */ if ( RDEXACT(fd, &buf->vm86_tss, sizeof(uint32_t)) || RDEXACT(fd, &buf->vm86_tss, sizeof(uint64_t)) ) @@ -717,7 +717,7 @@ static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx, } // DPRINTF("VM86 TSS location: %llx\n", buf->vm86_tss); return pagebuf_get_one(xch, ctx, buf, fd, dom); - } else if ( count == -5 ) { + } else if ( count == XC_SAVE_ID_TMEM ) { DPRINTF("xc_domain_restore start tmem\n"); if ( xc_tmem_restore(xch, dom, fd) ) { PERROR("error reading/restoring tmem"); @@ -725,13 +725,13 @@ static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx, } return pagebuf_get_one(xch, ctx, buf, fd, dom); } - else if ( count == -6 ) { + else if ( count == XC_SAVE_ID_TMEM_EXTRA ) { if ( xc_tmem_restore_extra(xch, dom, fd) ) { PERROR("error reading/restoring tmem extra"); return -1; } return pagebuf_get_one(xch, ctx, buf, fd, dom); - } else if ( count == -7 ) { + } else if ( count == XC_SAVE_ID_TSC_INFO ) { uint32_t tsc_mode, khz, incarn; uint64_t nsec; if ( RDEXACT(fd, &tsc_mode, sizeof(uint32_t)) || @@ -743,7 +743,7 @@ static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx, return -1; } return pagebuf_get_one(xch, ctx, buf, fd, dom); - } else if (count == -8 ) { + } else if (count == XC_SAVE_ID_HVM_CONSOLE_PFN ) { /* Skip padding 4 bytes then read the console pfn location. */ if ( RDEXACT(fd, &buf->console_pfn, sizeof(uint32_t)) || RDEXACT(fd, &buf->console_pfn, sizeof(uint64_t)) ) |