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

Re: [Xen-devel] [PATCH v2 2/2] libxendevicemodel: initialise extent to zero



> -----Original Message-----
> From: Wei Liu [mailto:wei.liu2@xxxxxxxxxx]
> Sent: 28 September 2017 11:36
> To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
> Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>; Wei Liu
> <wei.liu2@xxxxxxxxxx>; Ian Jackson <Ian.Jackson@xxxxxxxxxx>; Paul Durrant
> <Paul.Durrant@xxxxxxxxxx>
> Subject: [PATCH v2 2/2] libxendevicemodel: initialise extent to zero
> 
> The pad field needs to be zero as required by the hypervisor.
> 
> Instead of setting the pad separately, use C99 initialiser to clear
> extent.
> 
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Paul Durrant <paul.durrant@xxxxxxxxxx>
> 
> Backport to 4.9
> ---
>  tools/libs/devicemodel/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/libs/devicemodel/core.c b/tools/libs/devicemodel/core.c
> index fcb260d29b..986f147658 100644
> --- a/tools/libs/devicemodel/core.c
> +++ b/tools/libs/devicemodel/core.c
> @@ -483,7 +483,7 @@ int xendevicemodel_modified_memory(
>      xendevicemodel_handle *dmod, domid_t domid, uint64_t first_pfn,
>      uint32_t nr)
>  {
> -    struct xen_dm_op_modified_memory_extent extent;
> +    struct xen_dm_op_modified_memory_extent extent = { };

Not quite. I meant:

struct xen_dm_op_modified_memory_extent extent = { 
    .first_pfn = first_pfn,
    .nr = nr,
};

then you can drop the lines below.

  Paul

> 
>      extent.first_pfn = first_pfn;
>      extent.nr = nr;
> --
> 2.11.0


_______________________________________________
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®.