From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH] fix segfault in setting migration speed
Date: Tue, 14 Jul 2009 16:39:10 -0400 [thread overview]
Message-ID: <1247603950-5680-1-git-send-email-glommer@redhat.com> (raw)
Hi,
Whoever wrote this migrate_set_speed function is totally stupid.
Any failed or completed migration keeps its state to allow probing of
migration data, but has no associated file anymore. It is, thus,
possible to crash qemu by calling migrate_set_speed after a migration
is finished (or failed, or cancelled), but before another one starts.
This patch fixes it.
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
savevm.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/savevm.c b/savevm.c
index 17da35a..e577109 100644
--- a/savevm.c
+++ b/savevm.c
@@ -574,7 +574,9 @@ int qemu_file_rate_limit(QEMUFile *f)
size_t qemu_file_set_rate_limit(QEMUFile *f, size_t new_rate)
{
- if (f->set_rate_limit)
+ /* any failed or completed migration keeps its state to allow probing of
+ * migration data, but has no associated file anymore */
+ if (f && f->set_rate_limit)
return f->set_rate_limit(f->opaque, new_rate);
return 0;
--
1.6.2.2
next reply other threads:[~2009-07-14 20:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-14 20:39 Glauber Costa [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-07-14 22:26 [Qemu-devel] [PATCH] fix segfault in setting migration speed Glauber Costa
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=1247603950-5680-1-git-send-email-glommer@redhat.com \
--to=glommer@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=qemu-devel@nongnu.org \
/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 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).