]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: fix libxl_set_memory_target
authorWei Liu <wei.liu2@citrix.com>
Thu, 29 Dec 2016 16:36:31 +0000 (16:36 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 20 Jan 2017 17:38:19 +0000 (17:38 +0000)
Commit 26dbc93a ("libxl: Remove pointless hypercall from
libxl_set_memory_target") removed the call to xc_domain_getinfolist, but
it failed to notice that "info" was actually needed later.

Put that back. While at it, make the code conform to coding style
requirement.

Reported-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
(cherry picked from commit ed5f19aea66fe5a72060d6a795ffcd23b7643ee3)
(cherry picked from commit e1cefedd80f9972854769bfc6e32e23b56cd0712)

tools/libxl/libxl.c

index 9a888a17d94981890b29de59b3d721ad2ab64d55..322164bd9a394d46079ed9cc4eebf345436fb38b 100644 (file)
@@ -5031,6 +5031,13 @@ retry_transaction:
     libxl__xs_printf(gc, t, GCSPRINTF("%s/memory/target", dompath),
                      "%"PRIu32, new_target_memkb);
 
+    r = xc_domain_getinfolist(ctx->xch, domid, 1, &info);
+    if (r != 1 || info.domain != domid) {
+        abort_transaction = 1;
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
     libxl_dominfo_init(&ptr);
     xcinfo2xlinfo(ctx, &info, &ptr);
     uuid = libxl__uuid2string(gc, ptr.uuid);