Skip to contentSkip to conversation

xl: don't free additional memory on soft reset

PATCH Applied Vitaly Kuznetsov 3 participants 3 messages Jan 28, 2016 – Feb 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xl: don't free additional memory on soft reset

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.

---
 tools/libxl/xl_cmdimpl.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
tools/libxl/xl_cmdimpl.c +7 -5
index 25507c7..20704d2 100644
@@ -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;
Signature · 1 line
2.5.0
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Vitaly Kuznetsov

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.

Quoted 30 lines
---
 tools/libxl/xl_cmdimpl.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
tools/libxl/xl_cmdimpl.c +7 -5
index 25507c7..20704d2 100644
@@ -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;
Signature · 1 line
2.5.0