From: Thilo Boehm <tboehm(a)linux.vnet.ibm.com>
The properties for the on_xxx actions must be 16-bit values in
order to avoid failures on big endian systems.
Signed-off-by: Thilo Boehm <tboehm(a)linux.vnet.ibm.com>
Reviewed-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
libxkutil/device_parsing.c | 2 +-
libxkutil/device_parsing.h | 8 ++++----
src/Virt_VirtualSystemManagementService.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c
index aecca4c..0636864 100644
--- a/libxkutil/device_parsing.c
+++ b/libxkutil/device_parsing.c
@@ -1489,7 +1489,7 @@ static int parse_features(struct domain *dominfo, xmlNode
*features)
return 1;
}
-static void set_action(int *val, xmlNode *child)
+static void set_action(uint16_t *val, xmlNode *child)
{
char *action = (char *)xmlNodeGetContent(child);
diff --git a/libxkutil/device_parsing.h b/libxkutil/device_parsing.h
index 2803d6a..4beac5c 100644
--- a/libxkutil/device_parsing.h
+++ b/libxkutil/device_parsing.h
@@ -205,7 +205,7 @@ struct domain {
bool acpi;
bool apic;
bool pae;
- int autostrt;
+ uint16_t autostrt;
union {
struct pv_os_info pv;
@@ -213,9 +213,9 @@ struct domain {
struct lxc_os_info lxc;
} os_info;
- int on_poweroff;
- int on_reboot;
- int on_crash;
+ uint16_t on_poweroff;
+ uint16_t on_reboot;
+ uint16_t on_crash;
struct virt_device *dev_graphics;
int dev_graphics_ct;
diff --git a/src/Virt_VirtualSystemManagementService.c
b/src/Virt_VirtualSystemManagementService.c
index d51f230..89221bc 100644
--- a/src/Virt_VirtualSystemManagementService.c
+++ b/src/Virt_VirtualSystemManagementService.c
@@ -719,13 +719,13 @@ static int vssd_to_domain(CMPIInstance *inst,
if (ret != CMPI_RC_OK)
tmp = 0;
- domain->on_poweroff = (int)tmp;
+ domain->on_poweroff = tmp;
ret = cu_get_u16_prop(inst, "AutomaticRecoveryAction", &tmp);
if (ret != CMPI_RC_OK)
tmp = CIM_VSSD_RECOVERY_NONE;
- domain->on_crash = (int)tmp;
+ domain->on_crash = tmp;
if (cu_get_bool_prop(inst, "IsFullVirt", &fullvirt) != CMPI_RC_OK)
fullvirt = false;
--
1.7.9.5