diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index 1932758090..8ed1053575 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -916,7 +916,7 @@ static PyObject *pyxc_hvm_build(XcObject *self, char *image; int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1; PyObject *vcpu_avail_handle = NULL; - uint8_t vcpu_avail[HVM_MAX_VCPUS/8]; + uint8_t vcpu_avail[(HVM_MAX_VCPUS + 7)/8]; static char *kwd_list[] = { "domid", "memsize", "image", "target", "vcpus", diff --git a/xen/include/public/hvm/hvm_info_table.h b/xen/include/public/hvm/hvm_info_table.h index adb3fb9041..bdb5995e71 100644 --- a/xen/include/public/hvm/hvm_info_table.h +++ b/xen/include/public/hvm/hvm_info_table.h @@ -69,7 +69,7 @@ struct hvm_info_table { uint32_t high_mem_pgend; /* Bitmap of which CPUs are online at boot time. */ - uint8_t vcpu_online[HVM_MAX_VCPUS/8]; + uint8_t vcpu_online[(HVM_MAX_VCPUS + 7)/8]; }; #endif /* __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__ */