Statistics
| Branch: | Revision:

root / migration.c @ 2542bfd5

History | View | Annotate | Download (12.2 kB)

# Date Author Comment
7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

84ec6552 08/05/2011 07:55 pm Jan Kiszka

Reorganize and fix monitor resume after migration

If migration failed in migrate_fd_put_buffer, the monitor may have been
resumed not only in the error path of that function but also once again
in migrate_fd_put_ready which is called unconditionally by
migrate_fd_connect....

9e8dd451 07/23/2011 07:26 pm Jan Kiszka

notifier: Pass data argument to callback

This allows to pass additional information to the notifier callback
which is useful if sender and receiver do not share any other distinct
data structure.

Will be used first for the clock reset notifier.

Signed-off-by: Jan Kiszka <>...

e07bbac5 02/14/2011 04:39 pm Jan Kiszka

Improve vm_stop reason declarations

Define and use dedicated constants for vm_stop reasons, they actually
have nothing to do with the EXCP_* defines used so far. At this chance,
specify more detailed reasons so that VM state change handlers can
evaluate them....

99a0db9b 01/24/2011 04:13 pm Gerd Hoffmann

add migration state change notifiers

This patch adds functions to register and unregister notifiers for
migration state changes and a function to query the migration state.
The notifier is called on every state change. Once after establishing a
new migration object (which is in active state then) and once when the...

dc912121 01/17/2011 06:22 pm Alex Williamson

savevm: Fix no_migrate

The no_migrate save state flag is currently only checked in the
last phase of migration. This means that we potentially waste
a lot of time and bandwidth with the live state handlers before
we ever check the no_migrate flags. The error message printed...

eff06c40 12/09/2010 12:47 pm Michael S. Tsirkin

migration/savevm: no need to flush requests

There's no need to flush requests after vmstop
as vmstop does it for us automatically now.

Signed-off-by: Michael S. Tsirkin <>
Tested-by: Jason Wang <>

3d002df3 12/02/2010 09:13 pm Michael S. Tsirkin

migration: allow rate > 4g

I'd like to disable bandwidth limit or make it very high,
Use int64_t all over to make values >= 4g work.

Signed-off-by: Michael S. Tsirkin <>
Tested-by: Jason Wang <>

ed3d4a80 11/03/2010 07:48 pm Jes Sorensen

Switch migrate_set_speed() to take an 'o' argument rather than a float.

Clarify default value of MB in migration speed argument in monitor, if
no suffix is specified. This differ from previous default of bytes,
but is consistent with the rest of the places where we accept a size...

e447b1a6 08/19/2010 04:44 pm Marcelo Tosatti

set proper migration status on ->write error (v5)

If ->write fails, declare migration status as MIG_STATE_ERROR.

Also, in buffered_file.c, ->close the object in case of an
error.

Fixes "migrate -d "exec:dd of=file", where dd fails to open file.

Signed-off-by: Marcelo Tosatti <>...

8e84865e 07/31/2010 12:14 am Amit Shah

migration: Accept 'cont' only after successful incoming migration

When a 'cont' is issued on a VM that's just waiting for an incoming
migration, the VM reboots and boots into the guest, possibly corrupting
its storage since it could be shared with another VM running elsewhere....

eb159d13 07/01/2010 08:27 pm Luiz Capitulino

Monitor: handle optional '-' arg as a bool

Historically, user monitor arguments beginning with '-' (eg. '-f')
were passed as integers down to handlers.

I've maintained this behavior in the new monitor because we didn't
have a boolean type at the very beginning of QMP. Today we have it...

8ca5e801 06/22/2010 11:15 pm Juan Quintela

Exit if incoming migration fails

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

511c0231 06/22/2010 11:15 pm Juan Quintela

Factorize common migration incoming code

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

faa1f8dd 06/14/2010 11:46 pm Yoshiaki Tamura

migration: use qemu_free() instead of free().

Although there is no difference, other migration related code use
qemu_free(), and it should be better to be consistent.

Signed-off-by: Yoshiaki Tamura <>
Signed-off-by: Anthony Liguori <>

41ef56e6 06/03/2010 10:55 pm Anthony Liguori

migration: respect exit status with exec:

This patch makes sure that if the exec: process exits with a non-zero return
status, we treat the migration as failed.

This fixes https://bugs.launchpad.net/qemu/+bug/391879

Signed-off-by: Anthony Liguori <>

637503d1 06/01/2010 09:48 pm Luiz Capitulino

Monitor: Drop QMP documentation from code

Previous commit added QMP documentation to the qemu-monitor.hx
file, it's is a copy of this information.

While it's good to keep it near code, maintaining two copies of
the same information is too hard and has little benefit as we...

b5d17adb 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert do_migrate() to cmd_new_ret()

While there I'm also dropping a unneeded else clause (the last
one in the function).

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

ef4b7eee 02/19/2010 11:18 pm Luiz Capitulino

Monitor: Convert simple handlers to cmd_new_ret()

The following handlers always succeed and hence can be converted
to cmd_new_ret() in the same commit.

- do_stop()
- do_quit()
- do_system_reset()
- do_system_powerdown()
- do_migrate_cancel()
- do_qmp_capabilities()...

ba144141 02/10/2010 09:46 pm Luiz Capitulino

Monitor: remove unneeded checks

It's not needed to check the return of qobject_from_jsonf()
anymore, as an assert() has been added there.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

d0f2c4c6 02/07/2010 01:03 am malc

Do not use dprintf

dprintf is already claimed by POSIX1, and on at least one system
is implemented as a macro

[1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html

Signed-off-by: malc <>

5667c493 02/03/2010 08:36 pm Markus Armbruster

monitor: Use argument type 'b' for migrate_set_speed

Before, it used type 's', which strips quotes and interprets escapes,
and is quite inappropriate for QMP.

Negative arguments are no flushed to zero. Before, they were cast to
uint32_t, which wrecked the sign....

5fd9083c 02/03/2010 08:36 pm Markus Armbruster

monitor: convert do_migrate_set_speed() to QObject

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

b0fbf7d3 02/03/2010 08:36 pm Markus Armbruster

monitor: Use argument type 'T' for migrate_set_downtime

Before, it used type 's', which strips quotes and interprets escapes,
and is quite inappropriate for QMP.

Negative arguments are no flushed to zero. Before, they were cast to
uint32_t, which wrecked the sign....

c6027f56 02/03/2010 08:36 pm Markus Armbruster

monitor: convert do_migrate_set_downtime() to QObject

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

13232b8f 12/19/2009 04:26 pm Anthony Liguori

Revert "monitor: Convert do_migrate_set_speed() to QObject"

This reverts commit 3a4921047d514c336531c304bec362c4d138ebcc.

From Luiz:

do_migrate_set_speed() accepts a suffix for the 'value' argument and this is
not good for QMP. We will have to add a new argument type to handle that and...
c86a6683 12/12/2009 03:59 pm Luiz Capitulino

migration: Convert do_info_migrate() to QObject

Return a QDict, which may contain up to more two QDicts, depending
on the type of migration we're performing.

IMPORTANT: as a QInt stores a int64_t integer, RAM values are going
to be stored as int64_t and not as uint64_t as they are today. If...

4ec7fcc7 12/03/2009 06:48 pm Jan Kiszka

live migration: Allow cleanup after cancellation or error

Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel a
live migration. This gives the involved subsystems a chance to clean up
dynamically allocated resources. Namely, the block migration layer can...

f327aa0c 12/03/2009 06:48 pm Jan Kiszka

live migration: Propagate output monitor to callback handler

In order to allow proper progress reporting to the monitor that
initiated the migration, forward the monitor reference through the
migration layer down to SaveLiveStateHandler.

Signed-off-by: Jan Kiszka <>...

25f23643 12/03/2009 06:48 pm Jan Kiszka

block migration: Report progress also via info migration

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

5d39c799 12/03/2009 06:48 pm Jan Kiszka

migration: Fix use of file after release

qemu_fclose frees the passed file structure, but do_migrate_set_speed
may access it later on. Fix it by setting file NULL in
migrate_fd_cleanup and checking for this.

Signed-off-by: Jan Kiszka <>...

1302425d 12/03/2009 06:48 pm Jan Kiszka

migration: Catch multiple start commands

Signed-off-by: Jan Kiszka <>
Signed-off-by: Anthony Liguori <>

c163b5ca 11/17/2009 04:49 pm lirans@il.ibm.com

Block live migration

This patch introduces block migration called during live migration. Block
are being copied to the destination in an async way. First the code will
transfer the whole disk and then transfer all dirty blocks accumulted during
the migration....

5f79da00 10/27/2009 07:28 pm Luiz Capitulino

monitor: Convert do_migrate() to QObject

Error is still directly printed, as we are only converting
regular output.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

3a492104 10/27/2009 07:28 pm Luiz Capitulino

monitor: Convert do_migrate_set_speed() to QObject

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

911d2963 10/27/2009 07:28 pm Luiz Capitulino

monitor: Convert do_migrate_cancel() to QObject

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

d54908a5 09/04/2009 05:37 pm Luiz Capitulino

monitor: Port handler_1 to use QDict

This commit ports command handlers that receive one argument to use
the new monitor's dictionary.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

f18c16de 09/04/2009 05:37 pm Luiz Capitulino

monitor: Port handler_2 to use QDict

This commit ports command handlers that receive two arguments to use
the new monitor's dictionary.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>

f96fc8a0 09/04/2009 05:37 pm Luiz Capitulino

monitor: Port handler_0 to use QDict

This commit ports command handlers that receive no arguments to use
the new monitor's dictionary.

It might seem no sense to do this, as the handlers have no arguments,
but at the end of this porting work all handlers will have the same...

5ac1fad3 08/28/2009 03:33 am Paolo Bonzini

add file descriptor migration

Signed-off-by: Paolo Bonzini <>
Cc: Chris Lalancette <>
Signed-off-by: Anthony Liguori <>

4951f65b 08/24/2009 04:01 pm Chris Lalancette

Migration via unix sockets.

Implement migration via unix sockets. While you can fake this using
exec and netcat, this involves forking another process and is
generally not very nice. By doing this directly in qemu, we can avoid
the copy through the external nc command. This is useful for...

0884657b 07/10/2009 09:44 pm Glauber Costa

flush pending aio requests

When we finish migration, there may be pending async io requests
in flight. If we don't flush it before stage3 starting, it might be
the case that the guest loses it.

Signed-off-by: Glauber Costa <>
Signed-off-by: Anthony Liguori <>

eeb34af9 07/10/2009 12:58 am Anthony Liguori

Make sure to only vm_start() a failed migration if we were running to begin
with.

Signed-off-by: Anthony Liguori <>

2ea42952 06/16/2009 11:52 pm Glauber Costa

set migration max downtime

provide a monitor command to allow one to set the maximum
downtime he is willing to suffer during migration, in seconds.
"ms", "us", "ns" and "s" are accepted as modifiers.

This parameter will be used by ram_save_live() code to determine...

a0a3fd60 06/16/2009 11:45 pm Glauber Costa

add non-arbitrary migration stop condition

Currently, we're entering migration's stage 3 when
a treshold of 10 pages remain to be transferred in the system.

This has hurt some users. However, any proposed threshold is
arbitrary by nature, and would only shift the annoyance....

e19252d3 06/14/2009 03:19 am Uri Lublin

migrate_fd_close: delete associated io-handler before closing the fd

It may happen that the io-handler is still registered. That causes
select() to return with EBADF, not calling handlers for other fds.

The io-handler would be registered when (on the source) the whole state...

daa91de2 05/22/2009 06:50 pm Glauber Costa

allow changing the speed of a running migration

This patch allow us to call migrate_set_speed on running
migrations. This should allow mgmt tools to increase the allocated
bandwidth of a running migration if there is no progress, and they
really want the migration to succeed....

9f9e28cd 05/22/2009 06:50 pm Glauber Costa

augment info migrate with page status

This patch augments info migrate output with status about:
  • ram bytes remaining
  • ram bytes transferred
  • ram bytes total

This should be enough for management tools to realize
whether or not there is progress in migration. We can...

95b134ea 05/20/2009 05:12 pm Uri Lublin

migrate.c: migrate_fd_put_buffer: Do not busyloop: stop writing if EWOULDBLOCK

The migration code is non-blocking, designed for live migration.

Practically migrate_fd_put_buffer busy-loops trying to write, as
on many machines EWOULDBLOCK==EAGAIN (look in include/asm-generic/errno.h)....

b161d123 04/05/2009 10:30 pm aliguori

propagate error on failed completion (Glauber Costa)

migrate_fd_put_ready() calls qemu_savevm_state_complete(),
but the later can fail.

If it happens, re-start the vm and propagate the error up

Based on a patch by Yaniv Kamay

Signed-off-by: Glauber Costa <>...

cde76ee1 03/06/2009 01:01 am aliguori

monitor: Introduce MONITOR_USE_READLINE flag (Jan Kiszka)

This allows to create monitor terminals that do not make use of the
interactive readline back-end but rather send complete commands. The
pass-through monitor interface of the gdbstub will be an example....

731b0364 03/06/2009 01:01 am aliguori

monitor: Decouple terminals (Jan Kiszka)

Currently all registered (and activate) monitor terminals work in
broadcast mode: Everyone sees what someone else types on some other
terminal and what the monitor reports back. This model is broken when
you have a management monitor terminal that is automatically operated...

376253ec 03/06/2009 01:01 am aliguori

monitor: Rework API (Jan Kiszka)

Refactor the monitor API and prepare it for decoupled terminals:
term_print functions are renamed to monitor_* and all monitor services
gain a new parameter (mon) that will once refer to the monitor instance
the output is supposed to appear on. However, the argument remains...

065e2813 11/11/2008 06:46 pm aliguori

Reintroduce migrate-to-exec: support (Charles Duffy)

KVM's live migration support included support for exec: URLs, allowing system
state to be written or received via an arbitrary popen()ed subprocess. This
provides a convenient way to pipe state through a compression algorithm or an...

ff8d81d8 10/25/2008 01:10 am aliguori

Fix whitespace in migration code.

Replace tabs with spaces.

Signed-off-by: Anthony Liguori <>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5527 c046a42c-6fe2-441c-8c8c-71466251a162

34c9dd8e 10/13/2008 06:14 am aliguori

Introduce TCP live migration protocol

This patch introduces a tcp protocol for live migration. It can be used as
follows:

qemu-system-x86_64 -hda ~/images/linux-test.img -monitor stdio
<vm runs for a while>
(qemu) migrate tcp:localhost:1025

On the same system:...

5bb7910a 10/13/2008 06:12 am aliguori

Introduce UI for live migration

This patch introduces a command line parameter and monitor command for starting
a live migration. The next patch will provide an example of how to use these
parameters.

Signed-off-by: Anthony Liguori <>...