diff options
author | Anthony Perard <anthony.perard@citrix.com> | 2010-11-08 17:25:54 +0000 |
---|---|---|
committer | Anthony Perard <anthony.perard@citrix.com> | 2010-11-08 17:25:54 +0000 |
commit | a6aa655723f797b98fe8186eee59d0af7a143d40 (patch) | |
tree | 85d2819553b24f18254a6ea5ed9f8295b32f8c33 /tools/libxc/xc_domain_restore.c | |
parent | d32628fe3753a0e70def6db3d0f56428e5721b3d (diff) | |
download | xen-a6aa655723f797b98fe8186eee59d0af7a143d40.tar.gz xen-a6aa655723f797b98fe8186eee59d0af7a143d40.tar.bz2 xen-a6aa655723f797b98fe8186eee59d0af7a143d40.zip |
libxc: Save the HVM_PARAM_ACPI_IOPORTS_LOCATION
This will save the acpi_ioport_location hvm_param in the checkpoint file
and set the parameter in Xen at restore.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.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 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c index 6225e0ed94..f868283059 100644 --- a/tools/libxc/xc_domain_restore.c +++ b/tools/libxc/xc_domain_restore.c @@ -669,6 +669,7 @@ typedef struct { uint64_t identpt; uint64_t vm86_tss; uint64_t console_pfn; + uint64_t acpi_ioport_location; } pagebuf_t; static int pagebuf_init(pagebuf_t* buf) @@ -793,6 +794,16 @@ static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx, // DPRINTF("last checkpoint indication received"); return pagebuf_get_one(xch, ctx, buf, fd, dom); + case XC_SAVE_ID_HVM_ACPI_IOPORTS_LOCATION: + /* Skip padding 4 bytes then read the acpi ioport location. */ + if ( RDEXACT(fd, &buf->acpi_ioport_location, sizeof(uint32_t)) || + RDEXACT(fd, &buf->acpi_ioport_location, sizeof(uint64_t)) ) + { + PERROR("error read the acpi ioport location"); + return -1; + } + return pagebuf_get_one(xch, ctx, buf, fd, dom); + default: if ( (count > MAX_BATCH_SIZE) || (count < 0) ) { ERROR("Max batch size exceeded (%d). Giving up.", count); @@ -1342,6 +1353,15 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom, fcntl(io_fd, F_SETFL, orig_io_fd_flags | O_NONBLOCK); } + if (pagebuf.acpi_ioport_location == 1) { + DBGPRINTF("Use new firmware ioport from the checkpoint\n"); + xc_set_hvm_param(xch, dom, HVM_PARAM_ACPI_IOPORTS_LOCATION, 1); + } else if (pagebuf.acpi_ioport_location == 0) { + DBGPRINTF("Use old firmware ioport from the checkpoint\n"); + } else { + ERROR("Error, unknow acpi ioport location (%i)", pagebuf.acpi_ioport_location); + } + if ( ctx->last_checkpoint ) { // DPRINTF("Last checkpoint, finishing\n"); |