aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_domain_save.c
diff options
context:
space:
mode:
authorGeorge Dunlap <george.dunlap@eu.citrix.com>2011-02-25 17:26:18 +0000
committerGeorge Dunlap <george.dunlap@eu.citrix.com>2011-02-25 17:26:18 +0000
commitc15cad7df60be4de55233fd32a7f60a15886d226 (patch)
treef324f034c7e13a0dccfba123bc755f462484ba8b /tools/libxc/xc_domain_save.c
parent8bcd286054acdc3431ad342b647a162048867fbc (diff)
downloadxen-c15cad7df60be4de55233fd32a7f60a15886d226.tar.gz
xen-c15cad7df60be4de55233fd32a7f60a15886d226.tar.bz2
xen-c15cad7df60be4de55233fd32a7f60a15886d226.zip
libxc: Handle failed xc_get_hvm_param in domain save
The domain save code will read an HVM param, and if it's not zero, make an entry for it. However, if the hypercall fails for any reason, the data may not be written, and the value for the previous parameter may be written in the save file as the parameter that failed. Initialize the value to zero before each hypercall, so that in case of a failure, no value will be written. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_domain_save.c')
-rw-r--r--tools/libxc/xc_domain_save.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 22bab3c858..fa270f51f6 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1597,6 +1597,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
} chunk = { 0, };
chunk.id = XC_SAVE_ID_HVM_IDENT_PT;
+ chunk.data = 0;
xc_get_hvm_param(xch, dom, HVM_PARAM_IDENT_PT,
(unsigned long *)&chunk.data);
@@ -1608,6 +1609,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
}
chunk.id = XC_SAVE_ID_HVM_VM86_TSS;
+ chunk.data = 0;
xc_get_hvm_param(xch, dom, HVM_PARAM_VM86_TSS,
(unsigned long *)&chunk.data);
@@ -1619,6 +1621,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
}
chunk.id = XC_SAVE_ID_HVM_CONSOLE_PFN;
+ chunk.data = 0;
xc_get_hvm_param(xch, dom, HVM_PARAM_CONSOLE_PFN,
(unsigned long *)&chunk.data);
@@ -1630,6 +1633,7 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
}
chunk.id = XC_SAVE_ID_HVM_ACPI_IOPORTS_LOCATION;
+ chunk.data = 0;
xc_get_hvm_param(xch, dom, HVM_PARAM_ACPI_IOPORTS_LOCATION,
(unsigned long *)&chunk.data);