Statistics
| Branch: | Revision:

root / arch_init.c @ 6a1751b7

History | View | Annotate | Download (33 kB)

# Date Author Comment
0033b8b4 07/23/2013 12:12 pm Michael R. Hines

rdma: send pc.ram

This takes advantages of the previous patches:

1. use the new QEMUFileOps hook 'save_page'

2. call out to the right accessor methods to invoke
the iteration hooks defined in QEMUFileOps

Reviewed-by: Paolo Bonzini <>...

44c3b58c 07/23/2013 12:11 pm Michael R. Hines

rdma: introduce ram_handle_compressed()

This gives RDMA shared access to madvise() on the destination side
when an entire chunk is found to be zero.

Reviewed-by: Juan Quintela <>
Reviewed-by: Paolo Bonzini <>
Reviewed-by: Chegu Vinod <>...

7ca1dfad 07/12/2013 09:35 pm Chegu Vinod

Force auto-convegence of live migration

If a user chooses to turn on the auto-converge migration capability
these changes detect the lack of convergence and throttle down the
guest. i.e. force the VCPUs out of the guest for some duration
and let the migration thread catchup and help converge....

f1ff0e89 07/01/2013 02:11 am Alexander Graf

Graphics: Switch to 800x600x32 as default mode

We have stayed at 800x600x15 as default graphics mode for the last 9 years.
If there ever was a reason to be there, surely nobody remembers it.

However, recently non-Linux PPC guests started to show bad effects on 15 bit...

6bedfe94 06/28/2013 10:01 pm Stefan Weil

arch_init: Fix format string by using RAM_ADDR_FMT

length is a ram_addr_t, so RAM_ADDR_FMT must be used instead of %ld.
This fixes a recently introduced regression for w64 builds.

Using RAM_ADDR_FMT also changes decimal output to sedecimal.
This is good here because length and block->length should both...

2b0ce079 06/27/2013 03:38 am Michael R. Hines

rdma: introduce qemu_update_position()

RDMA writes happen asynchronously, and thus the performance accounting
also needs to be able to occur asynchronously. This allows anybody
to call into savevm.c to update both f->pos as well as into arch_init.c
to update the acct_info structure with up-to-date values when...

9ef051e5 06/27/2013 03:36 am Peter Lieven

Revert "migration: do not sent zero pages in bulk stage"

Not sending zero pages breaks migration if a page is zero
at the source but not at the destination. This can e.g. happen
if different BIOS versions are used at source and destination.
It has also been reported that migration on pseries is completely...

211ea740 06/27/2013 03:36 am Peter Lieven

migration: do not overwrite zero pages

on incoming migration do not memset pages to zero if they already read as zero.
this will allocate a new zero page and consume memory unnecessarily. even
if we madvise a MADV_DONTNEED later this will only deallocate the memory...

87d2f825 06/27/2013 03:32 am Alon Levy

arch_init/ram_load: add error message for block length mismatch

Makes it easier to debug situations where the source and target have
different ram blocks in a device and migration fails due to that, for
instance a BAR size change on a PCI device.

Signed-off-by: Alon Levy <>...

38aea177 06/17/2013 04:57 pm Anthony Liguori

Merge remote-tracking branch 'pmaydell/configury.next' into staging

  1. By Paolo Bonzini (4) and others
  2. Via Peter Maydell
    • pmaydell/configury.next:
      ppc: Remove CONFIG_FDT conditionals
      microblaze: Remove CONFIG_FDT conditionals
      arm: Remove CONFIG_FDT conditionals...
c02a9552 06/14/2013 05:33 pm Paolo Bonzini

build: drop TARGET_TYPE

Just use the TARGET_NAME free string.

Signed-off-by: Paolo Bonzini <>
Reviewed-by: Eric Blake <>
Message-id:
Signed-off-by: Peter Maydell <>

2e59915d 06/14/2013 05:33 pm Paolo Bonzini

main: use TARGET_ARCH only for the target-specific #define

Everything else needs to match the executable name, which is
TARGET_NAME.

Before:
$ sh4eb-linux-user/qemu-sh4eb --help
usage: qemu-sh4 [options] program [arguments...]
Linux CPU emulator (compiled for sh4 emulation)...

5bb95e41 06/14/2013 04:58 pm Markus Armbruster

smbios: Convert to error_report()

Improves diagnistics from ad hoc messages like

Invalid SMBIOS UUID string

to

qemu-system-x86_64: -smbios type=1,uuid=gaga: Invalid UUID

Signed-off-by: Markus Armbruster <>
Reviewed-by: Laszlo "ever the optimist" Ersek <>...

ebc85e3f 06/14/2013 04:58 pm Markus Armbruster

smbios: Clean up smbios_add_field() parameters

Having size precede the associated pointer is odd. Swap them, and fix
up the types.

Signed-off-by: Markus Armbruster <>
Reviewed-by: Laszlo "ever the optimist" Ersek <>
Message-id: ...

1d671369 05/24/2013 07:42 pm Paolo Bonzini

memory: make memory_global_sync_dirty_bitmap take an AddressSpace

Since this is a MemoryListener operation, it only makes sense
on an AddressSpace granularity.

Suggested-by: Peter Maydell <>
Signed-off-by: Paolo Bonzini <>

f81222bc 04/29/2013 08:16 pm Paolo Bonzini

audio: look for the ISA and PCI buses

Signed-off-by: Paolo Bonzini <>
Message-id:
Signed-off-by: Anthony Liguori <>

36cd6f6f 04/29/2013 08:16 pm Paolo Bonzini

audio: remove the need for audio card CONFIG_* symbols

Signed-off-by: Paolo Bonzini <>
Message-id:
Signed-off-by: Anthony Liguori <>

ffa48cf5 04/29/2013 08:16 pm Paolo Bonzini

audio: remove HAS_AUDIO

Several targets can have wavcapture/-soundhw support via PCI cards.
HAS_AUDIO is a useless limitation, remove it.

Signed-off-by: Paolo Bonzini <>
Message-id: ...

0bc3cd62 04/15/2013 07:19 pm Paolo Bonzini

include: avoid useless includes of exec/ headers

Headers in include/exec/ are for the deepest innards of QEMU,
they should almost never be included directly.

Signed-off-by: Paolo Bonzini <>

0445259b 04/15/2013 04:16 pm Michael S. Tsirkin

acpi: move declarations from pc.h to acpi.h

Functions defined in acpi/ should be declared in
acpi.h

Signed-off-by: Michael S. Tsirkin <>
Signed-off-by: Paolo Bonzini <>

0d09e41a 04/08/2013 07:13 pm Paolo Bonzini

hw: move headers to include/

Many of these should be cleaned up with proper qdev-/QOM-ification.
Right now there are many catch-all headers in include/hw/ARCH depending
on cpu.h, and this makes it necessary to compile these files per-target.
However, fixing this does not belong in these patches....

4d8b3c63 04/05/2013 03:23 am Laszlo Ersek

strip some whitespace

Signed-off-by: Laszlo Ersek <>
Reviewed-by: Anthony Liguori <>
Message-id:
Signed-off-by: Anthony Liguori <>

0c764a9d 04/05/2013 03:23 am Laszlo Ersek

acpi_table_add(): accept QemuOpts and parse it with OptsVisitor

As one consequence, strtok() -- which modifies its argument -- is replaced
with g_strsplit().

Signed-off-by: Laszlo Ersek <>
Reviewed-by: Anthony Liguori <>...

23084327 04/05/2013 03:23 am Laszlo Ersek

like acpi_table_install(), acpi_table_add() should propagate Errors

Signed-off-by: Laszlo Ersek <>
Reviewed-by: Anthony Liguori <>
Message-id:
Signed-off-by: Anthony Liguori <>

f1c72795 03/26/2013 02:32 pm Peter Lieven

migration: do not sent zero pages in bulk stage

during bulk stage of ram migration if a page is a
zero page do not send it at all.
the memory at the destination reads as zero anyway.

even if there is an madvise with QEMU_MADV_DONTNEED
at the target upon receipt of a zero page I have observed...

70c8652b 03/26/2013 02:32 pm Peter Lieven

migration: do not search dirty pages in bulk stage

avoid searching for dirty pages just increment the
page offset. all pages are dirty anyway.

Signed-off-by: Peter Lieven <>
Reviewed-by: Eric Blake <>
Reviewed-by: Orit Wasserman <>...

5cc11c46 03/26/2013 02:32 pm Peter Lieven

migration: use XBZRLE only after bulk stage

at the beginning of migration all pages are marked dirty and
in the first round a bulk migration of all pages is performed.

currently all these pages are copied to the page cache regardless
of whether they are frequently updated or not. this doesn't make sense...

500f0061 03/26/2013 02:32 pm Orit Wasserman

Use qemu_put_buffer_async for guest memory pages

This will remove an unneeded copy of guest memory pages.
For the page header and device state we still copy the data to the
static buffer the other option is to allocate the memory on demand
which is more expensive....

3edcd7e6 03/26/2013 02:32 pm Peter Lieven

migration: search for zero instead of dup pages

virtually all dup pages are zero pages. remove
the special is_dup_page() function and use the
optimized buffer_find_nonzero_offset() function
instead.

here buffer_find_nonzero_offset() is used directly
to avoid the unnecssary additional checks in...

78d07ae7 03/26/2013 02:32 pm Peter Lieven

migration: add an indicator for bulk state of ram migration

the first round of ram transfer is special since all pages
are dirty and thus all memory pages are transferred to
the target. this patch adds a boolean variable to track
this stage.

Signed-off-by: Peter Lieven <>...

c61ca00a 03/26/2013 02:30 pm Peter Lieven

move vector definitions to qemu-common.h

vector optimizations will now be used at various places
not just in is_dup_page() in arch_init.c

Signed-off-by: Peter Lieven <>
Signed-off-by: Juan Quintela <>

d15a9c23 03/23/2013 04:25 pm Anthony Green

Add top level changes for moxie

Signed-off-by: Anthony Green <>
Signed-off-by: Blue Swirl <>

ee0b44aa 03/11/2013 02:32 pm Peter Lieven

page_cache: dup memory on insert

The page cache frees all data on finish, on resize and
if there is collision on insert. So it should be the caches
responsibility to dup the data that is stored in the cache.

Signed-off-by: Peter Lieven <>
Signed-off-by: Orit Wasserman <>...

32c835ba 03/11/2013 02:32 pm Paolo Bonzini

migration: run pending/iterate callbacks out of big lock

This makes it possible to do blocking writes directly to the socket,
with no buffer in the middle. For RAM, only the migration_bitmap_sync()
call needs the iothread lock. For block migration, it is needed by...

9b095037 03/11/2013 02:32 pm Paolo Bonzini

migration: run setup callbacks out of big lock

Only the migration_bitmap_sync() call needs the iothread lock.

Reviewed-by: Orit Wasserman <>
Reviewed-by: Juan Quintela <>
Signed-off-by: Paolo Bonzini <>...

90f8ae72 02/22/2013 11:12 am Juan Quintela

migration: calculate expected_downtime

We removed the calculation in commit e4ed1541ac9413eac494a03532e34beaf8a7d1c5

Now we add it back. We need to create dirty_bytes_rate because we
can't include cpu-all.h from migration.c, and there is no other way to...

1b1fdfea 02/01/2013 09:32 am Orit Wasserman

Allow XBZRLE decoding without enabling the capability

Before this fix we couldn't load a guest from
XBZRLE compressed file.

For example:
The user activated the XBZRLE capability
The user run migrate -d "exec:gzip -c > vm.gz"
The user won't be able to load vm.gz and get an error....

fb3409de 01/17/2013 02:27 pm Paolo Bonzini

Unlock ramlist lock also in error case

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

Reviewed-by: Reviewed-by: Eric Blake <>

9c339485 01/17/2013 02:27 pm Paolo Bonzini

Protect migration_bitmap_sync() with the ramlist lock

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

Reviewed-by: Reviewed-by: Eric Blake <>

ece79318 12/21/2012 12:09 am Juan Quintela

ram: Use memory_region_test_and_clear_dirty

This avoids having to do two walks over the dirty bitmap, once reading
the dirty bits, and anthoer cleaning them.

Signed-off-by: Juan Quintela <>

4c8ae0f6 12/21/2012 12:09 am Juan Quintela

ram: optimize migration bitmap walking

Instead of testing each page individually, we search what is the next
dirty page with a bitmap operation. We have to reorganize the code to
move from a "for" loop, to a while(dirty) loop.

Signed-off-by: Juan Quintela <>

3f7d7b09 12/21/2012 12:09 am Juan Quintela

ram: account the amount of transferred ram better

Signed-off-by: Juan Quintela <>

b823ceaa 12/21/2012 12:09 am Juan Quintela

ram: refactor ram_save_block() return value

It could only return 0 if we only found dirty xbzrle pages that hadn't
changed (i.e. they were written with the same content). We don't care
about that case, it is the same than nothing dirty.

So now the return of the function is how much have it written, nothing...

b23a9a5c 12/21/2012 12:09 am Juan Quintela

ram: rename last_block to last_seen_block

Signed-off-by: Juan Quintela <>

5f718a15 12/21/2012 12:09 am Juan Quintela

ram: Add last_sent_block

This is the last block from where we have sent data.

Signed-off-by: Orit Wasserman <>
Signed-off-by: Juan Quintela <>

e4ed1541 12/21/2012 12:09 am Juan Quintela

savevm: New save live migration method: pending

Code just now does (simplified for clarity)

if (qemu_savevm_state_iterate(s->file) == 1) {
vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
qemu_savevm_state_complete(s->file);
}

Problem here is that qemu_savevm_state_iterate() returns 1 when it...

a3161038 12/21/2012 12:08 am Paolo Bonzini

exec: change RAM list to a TAILQ

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

abb26d63 12/21/2012 12:08 am Paolo Bonzini

exec: sort the memory from biggest to smallest

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

f798b07f 12/21/2012 12:08 am Umesh Deshpande

add a version number to ram_list

This will be used to detect if last_block might have become invalid
across different calls to ram_save_live.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Umesh Deshpande <>
Signed-off-by: Juan Quintela <>...

b2a8658e 12/21/2012 12:08 am Umesh Deshpande

protect the ramlist with a separate mutex

Add the new mutex that protects shared state between ram_save_live
and the iothread. If the iothread mutex has to be taken together
with the ramlist mutex, the iothread shall always be outside.

Signed-off-by: Paolo Bonzini <>...

0d6d3c87 12/21/2012 12:08 am Paolo Bonzini

exec: change ramlist from MRU order to a 1-item cache

Most of the time, only 2 items will be active (from/to for a string operation,
or code/data). But TCG guests likely won't have gigabytes of memory, so
this actually goes down to 1 item.

Signed-off-by: Paolo Bonzini <>...

244eaa75 12/20/2012 11:44 pm Paolo Bonzini

migration: fix migration_bitmap leak

Cc:
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Juan Quintela <>

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

83c9089e 12/19/2012 09:31 am Paolo Bonzini

monitor: move include files to include/monitor/

Signed-off-by: Paolo Bonzini <>

caf71f86 12/19/2012 09:31 am Paolo Bonzini

migration: move include files to include/migration/

Signed-off-by: Paolo Bonzini <>

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

7fa22f2b 12/19/2012 09:29 am Paolo Bonzini

net: do not include net.h everywhere

Signed-off-by: Paolo Bonzini <>

077805fa 12/19/2012 09:29 am Paolo Bonzini

janitor: do not rely on indirect inclusions of or from qemu-char.h

Various header files rely on qemu-char.h including qemu-config.h or
main-loop.h, but they really do not need qemu-char.h at all (particularly
interesting is the case of the block layer!). Clean this up, and also...

6f991980 12/17/2012 07:56 pm Paolo Bonzini

Merge commit '1dd3a74d2ee2d873cde0b390b536e45420b3fe05' into HEAD

Signed-off-by: Paolo Bonzini <>

a2cb15b0 12/17/2012 01:02 pm Michael S. Tsirkin

pci: update all users to look in pci/

update all users so we can remove the makefile hack.

Signed-off-by: Michael S. Tsirkin <>

7ec81e56 12/12/2012 11:03 pm David Gibson

Fix off-by-1 error in RAM migration code

The code for migrating (or savevm-ing) memory pages starts off by creating
a dirty bitmap and filling it with 1s. Except, actually, because bit
addresses are 0-based it fills every bit except bit 0 with 1s and puts an...

45e6cee4 12/12/2012 11:03 pm David Gibson

migration: Fix madvise breakage if host and guest have different page sizes

madvise(DONTNEED) will throw away the contents of the whole page at the
given address, even if the given length is less than the page size. One
can argue about whether that's the correct behaviour, but that's what it's...

79536f4f 10/17/2012 07:34 pm Juan Quintela

fix migration sync

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

c00012f6 10/17/2012 07:34 pm Juan Quintela

migration: rename expected_time to expected_downtime

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>
Reviewed-by: Orit Wasserman <>

2c52ddf1 10/17/2012 07:34 pm Juan Quintela

migration: print expected downtime in info migrate

Signed-off-by: Juan Quintela <>

5a170775 10/17/2012 07:34 pm Juan Quintela

savevm: Factorize ram globals reset in its own function

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>
Reviewed-by: Orit Wasserman <>

e44d26c8 10/17/2012 07:34 pm Juan Quintela

ram: introduce migration_bitmap_set_dirty()

It just marks a region of memory as dirty.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>
Reviewed-by: Orit Wasserman <>

69268cde 10/17/2012 07:34 pm Juan Quintela

ram: Introduce migration_bitmap_test_and_reset_dirty()

It just test if the dirty bit is set, and clears it.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>
Reviewed-by: Orit Wasserman <>

dd2df737 10/17/2012 07:34 pm Juan Quintela

ram: introduce migration_bitmap_sync()

Helper that we use each time that we need to syncronize the migration
bitmap with the other dirty bitmaps.

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

3c12193d 10/17/2012 07:34 pm Juan Quintela

ram: create trace event for migration sync bitmap

Signed-off-by: Juan Quintela <>

Reviewed-by: Paolo Bonzini <>

c6bf8e0e 10/17/2012 07:34 pm Juan Quintela

Separate migration bitmap

This patch creates a migration bitmap, which is periodically kept in
sync with the qemu bitmap. A separate copy of the dirty bitmap for the
migration limits the amount of concurrent access to the qemu bitmap
from iothread and migration thread (which requires taking the big...

8d017193 10/17/2012 07:34 pm Juan Quintela

migration: Add dirty_pages_rate to query migrate output

It indicates how many pages were dirtied during the last second.

Signed-off-by: Juan Quintela <>

ba6212d8 09/21/2012 04:12 pm Eduardo Habkost

Eliminate cpus-x86_64.conf file

This file is not needed anymore, as QEMU won't ship any config-based
cpudefs out of the box, relying only on the builtin CPU models.

Signed-off-by: Eduardo Habkost <>
Reviewed-by: Igor Mammedov <>...

55d4fd3c 09/19/2012 04:55 pm Peter Maydell

arch_init.c: Improve '-soundhw help' for non-HAS_AUDIO_CHOICE archs

For architectures which don't set HAS_AUDIO_CHOICE, improve the
'-soundhw help' message so that it doesn't simply print an empty
list, implying no sound support at all.

Signed-off-by: Peter Maydell <>...

ef37a699 09/14/2012 10:21 am Igor Mitsyanko

arch_init.c: add missing '%' symbols before PRIu64 in debug printfs

'%' symbols were missing in front of PRIu64 macros in DPRINTF messages in
arch_init.c, this caused compilation warnings when compiled with DEBUG_ARCH_INIT defined.

Signed-off-by: Igor Mitsyanko <>...

99afc91d 08/22/2012 06:47 pm Daniel P. Berrange

qapi: add 'query-target' command to return target arch

Add a 'query-target' QAPI command to allow management applications
to determine what target architecture a QEMU binary is emulating
without having to parse the binary name or -help output

$ qmp-shell -p /tmp/qemu...
ac839ccd 08/14/2012 12:02 am Anthony Liguori

Merge remote-tracking branch 'quintela/migration-next-20120808' into staging

  • quintela/migration-next-20120808:
    Restart optimization on stage3 update version
    Add XBZRLE statistics
    Add migration accounting for normal and duplicate pages
    Change total_time to total-time in MigrationStats...
4f23a1e6 08/11/2012 12:36 pm Guan Xuetao

unicore32-softmmu: Add unicore32-softmmu build support

This patch adds unicore32-softmmu build support, include configure,
makefile, arch_init, and all missing functions needed by softmmu.
Although all missing functions are empty, unicore32-softmmu could...

17ad9b35 08/08/2012 02:51 pm Orit Wasserman

Add XBZRLE to ram_save_block and ram_save_live

In the outgoing migration check to see if the page is cached and
changed, then send compressed page by using save_xbrle_page function.
In the incoming migration check to see if RAM_SAVE_FLAG_XBZRLE is set
and decompress the page (by using load_xbrle function)....

9e1ba4cc 08/08/2012 02:51 pm Orit Wasserman

Add migrate_set_cache_size command

Change XBZRLE cache size in bytes (the size should be a power of 2, it will be
rounded down to the nearest power of 2).
If XBZRLE cache size is too small there will be many cache miss.

New query-migrate-cache-size QMP command and 'info migrate_cache_size' HMP...

004d4c10 08/08/2012 02:51 pm Orit Wasserman

Add migration accounting for normal and duplicate pages

Signed-off-by: Benoit Hudzia <>
Signed-off-by: Petter Svard <>
Signed-off-by: Aidan Shribman <>
Signed-off-by: Orit Wasserman <>...

f36d55af 08/08/2012 02:51 pm Orit Wasserman

Add XBZRLE statistics

Signed-off-by: Benoit Hudzia <>
Signed-off-by: Petter Svard <>
Signed-off-by: Aidan Shribman <>
Signed-off-by: Orit Wasserman <>
Signed-off-by: Juan Quintela <>...

dd051c72 08/08/2012 02:51 pm Juan Quintela

Restart optimization on stage3 update version

Signed-off-by: Juan Quintela <>

Reviewed-by: Luiz Capitulino <>
Reviewed-by: Eric Blake <>

c8057f95 08/02/2012 09:16 pm Peter Maydell

Support 'help' as a synonym for '?' in command line options

For command line options which permit '?' meaning 'please list the
permitted values', add support for 'help' as a synonym, by abstracting
the check out into a helper function.

This change means that in some cases where we were being lazy in...

e6a76719 07/30/2012 05:58 pm Anthony Liguori

Merge commit 'quintela/migration-next-v5' into staging

  • commit '6c779f22a93cc6e4565b940ef616e3efc5b50ba5':
    Change ram_save_block to return -1 if there are no more changes
    ram: save_live_setup() we don't need to synchronize the dirty bitmap.
    ram: iterate phase...
e67db06e 07/28/2012 12:12 am Jia Liu

target-or32: Add target stubs and QOM cpu

Add OpenRISC target stubs, QOM cpu and basic machine.

Signed-off-by: Jia Liu <>
Signed-off-by: Blue Swirl <>

6c779f22 07/23/2012 03:02 pm Orit Wasserman

Change ram_save_block to return -1 if there are no more changes

It will return 0 if the page is unmodifed.

Signed-off-by: Orit Wasserman <>

7908c78d 07/20/2012 09:19 am Juan Quintela

savevm: Live migration handlers register the struct directly

Notice that the live migration users never unregister, so no problem
about freeing the ops structure.

Signed-off-by: Juan Quintela <>

9b5bfab0 07/20/2012 09:19 am Juan Quintela

savevm: Refactor cancel operation in its own operation

Intead of abusing stage with value -1.

Signed-off-by: Juan Quintela <>

d1315aac 07/20/2012 09:19 am Juan Quintela

savevm: split save_live_setup from save_live_state

This patch splits stage 1 to its own function for both save_live
users, ram and block. It is just a copy of the function, removing the
parts of the other stages. Optimizations would came later.

Signed-off-by: Juan Quintela <>

16310a3c 07/20/2012 09:19 am Juan Quintela

savevm: split save_live into stage2 and stage3

We split it into 2 functions, foo_live_iterate, and foo_live_complete.
At this point, we only remove the bits that are for the other stage,
functionally this is equivalent to previous code.

Signed-off-by: Juan Quintela <>

5910d1e6 07/20/2012 09:19 am Juan Quintela

ram: save_live_setup() don't need to sent pages

We should send pages on interate phase, not in setup one. This was a
"bug". Just removing the loop does what we want. Tested that it
works with current ram_load().

Signed-off-by: Juan Quintela <>

b81e712d 07/20/2012 09:19 am Juan Quintela

ram: save_live_complete() only do one loop

We were doing the same loop that stage2, and a new one for stage3. We
only need the one for stage3.

Signed-off-by: Juan Quintela <>

00d94f3f 07/20/2012 09:19 am Juan Quintela

ram: iterate phase

We only need to synchronize the bitmap when the number of dirty pages is low.
Not every time that we call the function.

Signed-off-by: Juan Quintela <>

6d2fe810 07/20/2012 09:19 am Juan Quintela

ram: save_live_setup() we don't need to synchronize the dirty bitmap.

1st: we were synchonizing the dirty bitmap before calling
memory_global_dirty_log_start().

2nd: We are marking all pages as dirty anywhere, no reason to go
through all the bitmap to "mark" dirty same pages twice....

45f33f01 06/29/2012 02:31 pm Juan Quintela

Maintain the number of dirty pages

Calculate the number of dirty pages takes a lot on hosts with lots
of memory. Just maintain how many pages are dirty.

Signed-off-by: Juan Quintela <>

4508bd9e 06/29/2012 02:31 pm Juan Quintela

Exit loop if we have been there too long

Checking each 64 pages is a random magic number as good as any other.
We don't want to test too many times, but on the other hand,
qemu_get_clock_ns() is not so expensive either. We want to be sure
that we spent less than 50ms (half of buffered_file timer), if we...

5b3c9638 06/29/2012 02:28 pm Juan Quintela

Only calculate expected_time for stage 2

ram_save_remaining() is an expensive operation when there is a lot of memory.
So we only call the function when we need it.

Signed-off-by: Juan Quintela <>

8e21cd32 06/29/2012 02:27 pm Orit Wasserman

Add migration_end function

Signed-off-by: Orit Wasserman <>