aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_domain_restore.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libxc/xc_domain_restore.c')
-rw-r--r--tools/libxc/xc_domain_restore.c20
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");