From a6aa655723f797b98fe8186eee59d0af7a143d40 Mon Sep 17 00:00:00 2001 From: Anthony Perard Date: Mon, 8 Nov 2010 17:25:54 +0000 Subject: 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 Acked-by: Ian Jackson Signed-off-by: Ian Jackson --- tools/libxc/xc_domain_restore.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tools/libxc/xc_domain_restore.c') 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"); -- cgit v1.2.3