>>> On 05.08.16 at 15:50, <andrew.coop...@citrix.com> wrote:
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -188,7 +188,7 @@ void getdomaininfo(struct domain *d, struct 
> xen_domctl_getdomaininfo *info)
>          (d->controller_pause_count > 0  ? XEN_DOMINF_paused    : 0) |
>          (d->debugger_attached           ? XEN_DOMINF_debugged  : 0) |
>          (d->is_xenstore                 ? XEN_DOMINF_xs_domain : 0) |
> -        d->shutdown_code << XEN_DOMINF_shutdownshift;
> +        (unsigned int)d->shutdown_code << XEN_DOMINF_shutdownshift;

Is adding a cast here really the most suitable fix? The only two places
shutdown_code gets set (besides the -1 initialization) have their right
side a u8. Nothing ever checks for the value being negative (there are
just two -1 checks), so converting the field to u8 or unsigned int (and
using a sentinel different from -1) should both work, avoiding the need
for a cast.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to