From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 0/3] add "core dump"-like capability
Date: Thu, 9 Jul 2009 13:47:36 +0200 [thread overview]
Message-ID: <1247140059-5034-1-git-send-email-pbonzini@redhat.com> (raw)
Unlike for example xen, KVM virtualized guests do not have a method to
generate something like a core file. While kdump could help in the
case of a crash, it does not cater for non-Linux operating systems
and does not help with dumping the state live, while the machine is
running.
The existing savevm stuff (besides not being supported by libvirt)
does not perform the dump live; it stops the virtual machine before
saving. One way to do this could be to start migrating to "exec:dd
of=OUT-FILE-NAME" and somehow restart the machine as soon as the migration
ends. This (except the restarting part) is similar to how libvirt
implements VM snapshotting. However this has several disadvantages:
1) it is not possible when the terminal does not support synchronous
migration;
2) I'm not sure how easy it would be to "script" it from libvirt -- I
have not tried;
3) last but not least, filename completion would not work from the
QEMU monitor itself. :-)
For this reason I instead opted for a new monitor command, "dump"
(suggestions for a different name are welcome). The command is
still based on the migration mechanism, the only differences are the
destination, which is a file rather than a URI, and the fact that the
VM is restarted after its state (actually the parts that cannot be saved
live) is saved.
This approach is somewhat obvious and packs a lot of functionality in
a relatively small patch set (e.g. "info migrate" and "migrate_cancel"
will work for dumps too). Still it does not come without disadvantages:
1) it is impossible to dump and migrate at the same time, though
this is mostly due to limitations of the monitor interface;
2) it is somewhat unintuitive that migrate commands (migrate_cancel in
particular) affect dumps as well.
The patch set is structured as follows.
Patch 1 is a cleanup to move some of the migration logic from
FdMigrationState to MigrationState. In particular the
active/completed/cancelled/error "state machine" becomes part
of MigrationState.
Patch 2 adds a new state to this state machine, COMPLETING, which is when
the data is not completely written but the VM is stopped. The new design
simplifies the implementation of live dumping, but arguably this patch
also fixes rare bugs that I found by inspection (see the patch itself).
I'm selling this as a point in favor of the patch.
Patch 3 finally introduces the new command. The patch is by far
the simplest of the three.
migration-exec.c | 56 ++++++++++++++++++++++-----
migration-tcp.c | 8 +---
migration.c | 111 ++++++++++++++++++++++++++++++++++++++---------------
migration.h | 26 +++++++++---
qemu-monitor.hx | 8 ++++
5 files changed, 153 insertions(+), 56 deletions(-)
next reply other threads:[~2009-07-09 11:47 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-09 11:47 Paolo Bonzini [this message]
2009-07-09 11:47 ` [Qemu-devel] [PATCH 1/3] move state and mon_resume to struct MigrationState Paolo Bonzini
2009-07-09 11:47 ` [Qemu-devel] [PATCH 2/3] move vm stop/start to migrate_set_state Paolo Bonzini
2009-07-09 13:45 ` Anthony Liguori
2009-07-09 13:48 ` Paolo Bonzini
2009-07-09 13:53 ` Anthony Liguori
2009-07-09 13:58 ` Paolo Bonzini
2009-07-09 14:41 ` Anthony Liguori
2009-07-10 23:14 ` Jamie Lokier
2009-07-11 0:04 ` malc
2009-07-11 0:42 ` Jamie Lokier
2009-07-11 0:55 ` Anthony Liguori
2009-07-11 0:58 ` Anthony Liguori
2009-07-11 1:42 ` Jamie Lokier
2009-07-12 3:31 ` Anthony Liguori
2009-07-12 14:22 ` Avi Kivity
2009-07-12 19:10 ` Anthony Liguori
2009-07-12 19:30 ` Avi Kivity
2009-07-13 5:31 ` Gleb Natapov
2009-07-13 8:05 ` Gleb Natapov
2009-07-13 14:52 ` Anthony Liguori
2009-07-14 8:48 ` Dor Laor
2009-07-14 14:41 ` Paolo Bonzini
2009-07-09 11:47 ` [Qemu-devel] [PATCH 3/3] add live dumping capability Paolo Bonzini
2009-07-09 13:49 ` Anthony Liguori
2009-07-09 14:06 ` Paolo Bonzini
2009-07-09 14:43 ` Anthony Liguori
2009-07-10 8:32 ` Paolo Bonzini
2009-07-10 12:51 ` Anthony Liguori
2009-07-09 13:42 ` [Qemu-devel] [PATCH 0/3] add "core dump"-like capability Anthony Liguori
2009-07-09 13:46 ` Paolo Bonzini
2009-07-09 13:51 ` Anthony Liguori
2009-07-09 14:46 ` Gerd Hoffmann
2009-07-09 16:20 ` Paolo Bonzini
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=1247140059-5034-1-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.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).