xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xl: don't free additional memory on soft reset
@ 2016-01-28 10:58 Vitaly Kuznetsov
  2016-02-01 10:39 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Vitaly Kuznetsov @ 2016-01-28 10:58 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu, Ian Jackson, Ian Campbell, Stefano Stabellini

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>
---
 tools/libxl/xl_cmdimpl.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 25507c7..20704d2 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -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;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-03 11:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-28 10:58 [PATCH] xl: don't free additional memory on soft reset Vitaly Kuznetsov
2016-02-01 10:39 ` Wei Liu
2016-02-03 11:48   ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).