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 <jgr...@suse.com>
Signed-off-by: Wei Liu <wei.l...@citrix.com>
---
Cc: Juergen Gross <jgr...@suse.com>
Cc: Ian Jackson <ian.jack...@eu.citrix.com>

I'm not really sure how useful it is to store memory information under
/vm path. For now let's err on the safe side.

Should be backported to 4.7 and 4.8.
---
 tools/libxl/libxl.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 6fd4fe1..2f83731 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -4308,6 +4308,13 @@ retry_transaction:
     libxl__xs_printf(gc, t, GCSPRINTF("%s/memory/target", dompath),
                      "%"PRIu64, 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);
-- 
2.1.4


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

Reply via email to