From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, quintela@redhat.com
Cc: peterx@redhat.com
Subject: [Qemu-devel] [PATCH 1/2] migration: Fix early failure cleanup
Date: Mon, 12 Feb 2018 16:03:39 +0000 [thread overview]
Message-ID: <20180212160340.15333-2-dgilbert@redhat.com> (raw)
In-Reply-To: <20180212160340.15333-1-dgilbert@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Avoid crash in cleanup after a very early migration failure
(possibly due to my 688a3dcba980bf01344a 'Route errors down ...')
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/ram.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 8333d8e35e..7095c1040e 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1602,11 +1602,13 @@ static void xbzrle_load_cleanup(void)
static void ram_state_cleanup(RAMState **rsp)
{
- migration_page_queue_free(*rsp);
- qemu_mutex_destroy(&(*rsp)->bitmap_mutex);
- qemu_mutex_destroy(&(*rsp)->src_page_req_mutex);
- g_free(*rsp);
- *rsp = NULL;
+ if (*rsp) {
+ migration_page_queue_free(*rsp);
+ qemu_mutex_destroy(&(*rsp)->bitmap_mutex);
+ qemu_mutex_destroy(&(*rsp)->src_page_req_mutex);
+ g_free(*rsp);
+ *rsp = NULL;
+ }
}
static void xbzrle_cleanup(void)
--
2.14.3
next prev parent reply other threads:[~2018-02-12 16:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-12 16:03 [Qemu-devel] [PATCH 0/2] migration: Fix early failure crash Dr. David Alan Gilbert (git)
2018-02-12 16:03 ` Dr. David Alan Gilbert (git) [this message]
2018-02-12 16:03 ` [Qemu-devel] [PATCH 2/2] tests/migration: Add test for migration to bad destination Dr. David Alan Gilbert (git)
2018-02-20 11:56 ` Thomas Huth
2018-02-20 13:26 ` Juan Quintela
2018-02-13 3:56 ` [Qemu-devel] [PATCH 0/2] migration: Fix early failure crash Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180212160340.15333-2-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.