aboutsummaryrefslogtreecommitdiff
path: root/migration
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2017-05-18 10:16:38 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2017-05-18 13:36:15 +0100
commit56821559f0ba682fe6b367815572e6f974d329ab (patch)
tree75e93f8fc47707f61c1f6ad5ac45c7609c8da15a /migration
parent2ccbd47c1def618b31af1d88b550f6d2bdd15b0f (diff)
parentbe9b23c4a539090da30b482015ee660850e8bb5f (diff)
Merge remote-tracking branch 'dgilbert/tags/pull-hmp-20170517' into staging
HMP pull # gpg: Signature made Wed 17 May 2017 07:03:39 PM BST # gpg: using RSA key 0x0516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * dgilbert/tags/pull-hmp-20170517: ramblock: add new hmp command "info ramblock" utils: provide size_to_str() ramblock: add RAMBLOCK_FOREACH() Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r--migration/ram.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/migration/ram.c b/migration/ram.c
index 76c118c271..f59fdd41a4 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -655,7 +655,7 @@ uint64_t ram_pagesize_summary(void)
RAMBlock *block;
uint64_t summary = 0;
- QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
+ RAMBLOCK_FOREACH(block) {
summary |= block->page_size;
}
@@ -683,7 +683,7 @@ static void migration_bitmap_sync(RAMState *rs)
qemu_mutex_lock(&rs->bitmap_mutex);
rcu_read_lock();
- QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
+ RAMBLOCK_FOREACH(block) {
migration_bitmap_sync_range(rs, block, 0, block->used_length);
}
rcu_read_unlock();
@@ -1415,8 +1415,9 @@ uint64_t ram_bytes_total(void)
uint64_t total = 0;
rcu_read_lock();
- QLIST_FOREACH_RCU(block, &ram_list.blocks, next)
+ RAMBLOCK_FOREACH(block) {
total += block->used_length;
+ }
rcu_read_unlock();
return total;
}
@@ -1507,7 +1508,7 @@ void ram_postcopy_migrated_memory_release(MigrationState *ms)
{
struct RAMBlock *block;
- QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
+ RAMBLOCK_FOREACH(block) {
unsigned long *bitmap = block->bmap;
unsigned long range = block->used_length >> TARGET_PAGE_BITS;
unsigned long run_start = find_next_zero_bit(bitmap, range, 0);
@@ -1585,7 +1586,7 @@ static int postcopy_each_ram_send_discard(MigrationState *ms)
struct RAMBlock *block;
int ret;
- QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
+ RAMBLOCK_FOREACH(block) {
PostcopyDiscardState *pds =
postcopy_discard_send_init(ms, block->idstr);
@@ -1968,7 +1969,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
qemu_put_be64(f, ram_bytes_total() | RAM_SAVE_FLAG_MEM_SIZE);
- QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
+ RAMBLOCK_FOREACH(block) {
qemu_put_byte(f, strlen(block->idstr));
qemu_put_buffer(f, (uint8_t *)block->idstr, strlen(block->idstr));
qemu_put_be64(f, block->used_length);