]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
xl: don't free additional memory on soft reset
authorVitaly Kuznetsov <vkuznets@redhat.com>
Thu, 28 Jan 2016 10:58:25 +0000 (11:58 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 3 Feb 2016 11:18:38 +0000 (11:18 +0000)
We don't need to free anything extra from Dom0 in order to perform soft
reset. It can also fail soft reset if it happens that we don't have this
memory (which we don't need) available.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/xl_cmdimpl.c

index 25507c77f8a136793769641877b31e7a5527e7e7..20704d28a5ec3773aec51723d3f9a52d9e1fc5d4 100644 (file)
@@ -2867,11 +2867,13 @@ start:
     if (rc < 0)
         goto error_out;
 
-    ret = freemem(domid, &d_config.b_info);
-    if (ret < 0) {
-        fprintf(stderr, "failed to free memory for the domain\n");
-        ret = ERROR_FAIL;
-        goto error_out;
+    if (domid_soft_reset == INVALID_DOMID) {
+        ret = freemem(domid, &d_config.b_info);
+        if (ret < 0) {
+            fprintf(stderr, "failed to free memory for the domain\n");
+            ret = ERROR_FAIL;
+            goto error_out;
+        }
     }
 
     libxl_asyncprogress_how autoconnect_console_how_buf;