[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC PATCH 3/6] libxl: implement control feature checking



Paul Durrant writes ("[RFC PATCH 3/6] libxl: implement control feature 
checking"):
> docs/misc/xenstore-paths documents a set of feature flags that can be used
> to determine whether values written to ~/control/shutdown will result in
> actions in the guest.
> 
> This patch adds empty guest writable values into xenstore for each
> documented feature flag (to allow the guest to update them) and also code
> to check these flags to determine whether a specific use of
> libxl__domain_pvcontrol() will definitely *not* result in action and fail
> the call immediately.

I am going to go back and see what you wrote in the spec, but this
patch is only correct if the guest is not permitted to infer anything
from the existence of these nodes.

> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 279deda..cc82311 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -619,6 +619,28 @@ retry_transaction:
>                             libxl__sprintf(gc, "%s/shutdown", control_path),
>                             rwperm, ARRAY_SIZE(rwperm),
>                             "");
> +    libxl__xs_printf_perms(gc, t,
> +                           libxl__sprintf(gc, "%s/feature-poweroff", 
> control_path),
> +                           rwperm, ARRAY_SIZE(rwperm),
> +                           "");
> +    libxl__xs_printf_perms(gc, t,
> +                           libxl__sprintf(gc, "%s/feature-reboot", 
> control_path),
> +                           rwperm, ARRAY_SIZE(rwperm),
> +                           "");

This is really very repetitive and also needs more energetic wrapping
and also needs to use GCSPRINTF.  (Indeed, in several parts of this
patch you replace GCSPRINTF calls, but your new code is all
libxl__sprintf(gc,)).

Thanks,
Ian.

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.