WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: paging_domctl() missing break statements?

>>> On 23.06.10 at 18:27, Patrick Colp <pjcolp@xxxxxxxxx> wrote:
> The problem with the patch is that with the break statements in the
> "else" cases of XEN_DOMCTL_SHADOW_OP_ENABLE and
> XEN_DOMCTL_SHADOW_OP_OFF it currently falls through. Simply sticking
> break in at the bottom changes these control flow paths.
> 
> So a (more) proper patch should replicate the code of
> XEN_DOMCTL_SHADOW_OP_OFF (and of OP_CLEAN and OP_PEEK):
> 
>         if ( paging_mode_log_dirty(d) )
>             if ( (rc = paging_log_dirty_disable(d)) != 0 )
>                 return rc;
> 
> and
> 
>          return paging_log_dirty_op(d, sc);
> 
> before the break statement. Same with the XEN_DOMCTL_SHADOW_OP_OFF
> case statement... it should have:
> 
>          return paging_log_dirty_op(d, sc);
> 
> after the initial if statement as its "else" case.

That means you consider the current behavior right, i.e. the fall
through being intentional. If that's indeed the case, rather than
replicating the code I'd suggest just annotating the code to state
that the fall through is intentional in both places (as is common
practice elsewhere).

Jan

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel