diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/exec/ram_addr.h | 8 | ||||
| -rw-r--r-- | include/migration/migration.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index ef1489da77..606e277092 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -38,10 +38,14 @@ struct RAMBlock { int fd; }; +static inline bool offset_in_ramblock(RAMBlock *b, ram_addr_t offset) +{ + return (b && b->host && offset < b->used_length) ? true : false; +} + static inline void *ramblock_ptr(RAMBlock *block, ram_addr_t offset) { - assert(offset < block->used_length); - assert(block->host); + assert(offset_in_ramblock(block, offset)); return (char *)block->host + offset; } diff --git a/include/migration/migration.h b/include/migration/migration.h index 0fc1ffa9a9..74684ad929 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -133,7 +133,7 @@ struct MigrationState size_t xfer_limit; QemuThread thread; QEMUBH *cleanup_bh; - QEMUFile *file; + QEMUFile *to_dst_file; int parameters[MIGRATION_PARAMETER__MAX]; int state; |