* [Qemu-devel] [PATCH] fix segfault in setting migration speed
@ 2009-07-14 20:39 Glauber Costa
0 siblings, 0 replies; 2+ messages in thread
From: Glauber Costa @ 2009-07-14 20:39 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] [PATCH] fix segfault in setting migration speed
@ 2009-07-14 22:26 Glauber Costa
0 siblings, 0 replies; 2+ messages in thread
From: Glauber Costa @ 2009-07-14 22:26 UTC (permalink / raw)
To: qemu-devel; +Cc: aliguori
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-14 22:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-14 22:26 [Qemu-devel] [PATCH] fix segfault in setting migration speed Glauber Costa
-- strict thread matches above, loose matches on Subject: below --
2009-07-14 20:39 Glauber Costa
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).