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

Re: [Xen-devel] [PATCH v3 05/12] tools/libxenctrl: use new xenforeignmemory API to seed grant table



On Thu, Aug 31, 2017 at 10:35:58AM +0100, Paul Durrant wrote:
> A previous patch added support for priv-mapping guest resources directly
> (rather than having to foreign-map, which requires P2M modification for
> HVM guests).
> 
> This patch makes use of the new API to seed the guest grant table unless
> the underlying infrastructure (i.e. privcmd) doesn't support it, in which
> case the old scheme is used.
> 
> NOTE: The call to xc_dom_gnttab_hvm_seed() in hvm_build_set_params() was
>       actually unnecessary, as the grant table has already been seeded
>       by a prior call to xc_dom_gnttab_init() made by libxl__build_dom().
> 
> Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
> Acked-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

[...]

> +int xc_dom_gnttab_init(struct xc_dom_image *dom)
> +{
> +    xc_interface *xch = dom->xch;
> +    domid_t guest_domid = dom->guest_domid;
> +    bool is_hvm = xc_dom_translated(dom);
> +    xen_pfn_t console_gmfn = xc_dom_p2m(dom, dom->console_pfn);
> +    xen_pfn_t xenstore_gmfn = xc_dom_p2m(dom, dom->xenstore_pfn);
> +    domid_t console_domid = dom->console_domid;
> +    domid_t xenstore_domid = dom->xenstore_domid;

It looks weird to have all this local variables that are used only
once. I would probably remove the dom->... ones.

Thanks, Roger.

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

 


Rackspace

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