]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
libxendevicemodel: initialise extent.pad to zero
authorWei Liu <wei.liu2@citrix.com>
Thu, 28 Sep 2017 10:00:00 +0000 (11:00 +0100)
committerWei Liu <wei.liu2@citrix.com>
Thu, 28 Sep 2017 10:57:45 +0000 (11:57 +0100)
The pad field needs to be zero as required by the hypervisor.

Instead of setting the pad separately, use C99 initialiser.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
tools/libs/devicemodel/core.c

index fcb260d29ba11a71d309b7a4f2e38995f1b7532d..0f2c1a791f0ed0325384ff5aff31c0138947ae25 100644 (file)
@@ -483,10 +483,10 @@ 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;
-
-    extent.first_pfn = first_pfn;
-    extent.nr = nr;
+    struct xen_dm_op_modified_memory_extent extent = {
+        .first_pfn = first_pfn,
+        .nr = nr,
+    };
 
     return xendevicemodel_modified_memory_bulk(dmod, domid, &extent, 1);
 }