qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] add "core dump"-like capability
@ 2009-07-09 11:47 Paolo Bonzini
  2009-07-09 11:47 ` [Qemu-devel] [PATCH 1/3] move state and mon_resume to struct MigrationState Paolo Bonzini
                   ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Paolo Bonzini @ 2009-07-09 11:47 UTC (permalink / raw)
  To: qemu-devel

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(-)

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

end of thread, other threads:[~2009-07-14 14:41 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-09 11:47 [Qemu-devel] [PATCH 0/3] add "core dump"-like capability Paolo Bonzini
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

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).