mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 11:39:53 +00:00
ram: ram_discard_range() don't use the mis parameter
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
15440dd5a0
commit
aaa2064c2a
@ -270,8 +270,7 @@ void ram_debug_dump_bitmap(unsigned long *todump, bool expected);
|
|||||||
/* For outgoing discard bitmap */
|
/* For outgoing discard bitmap */
|
||||||
int ram_postcopy_send_discard_bitmap(MigrationState *ms);
|
int ram_postcopy_send_discard_bitmap(MigrationState *ms);
|
||||||
/* For incoming postcopy discard */
|
/* For incoming postcopy discard */
|
||||||
int ram_discard_range(MigrationIncomingState *mis, const char *block_name,
|
int ram_discard_range(const char *block_name, uint64_t start, size_t length);
|
||||||
uint64_t start, size_t length);
|
|
||||||
int ram_postcopy_incoming_init(MigrationIncomingState *mis);
|
int ram_postcopy_incoming_init(MigrationIncomingState *mis);
|
||||||
void ram_postcopy_migrated_memory_release(MigrationState *ms);
|
void ram_postcopy_migrated_memory_release(MigrationState *ms);
|
||||||
|
|
||||||
|
@ -213,8 +213,6 @@ out:
|
|||||||
static int init_range(const char *block_name, void *host_addr,
|
static int init_range(const char *block_name, void *host_addr,
|
||||||
ram_addr_t offset, ram_addr_t length, void *opaque)
|
ram_addr_t offset, ram_addr_t length, void *opaque)
|
||||||
{
|
{
|
||||||
MigrationIncomingState *mis = opaque;
|
|
||||||
|
|
||||||
trace_postcopy_init_range(block_name, host_addr, offset, length);
|
trace_postcopy_init_range(block_name, host_addr, offset, length);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -223,7 +221,7 @@ static int init_range(const char *block_name, void *host_addr,
|
|||||||
* - we're going to get the copy from the source anyway.
|
* - we're going to get the copy from the source anyway.
|
||||||
* (Precopy will just overwrite this data, so doesn't need the discard)
|
* (Precopy will just overwrite this data, so doesn't need the discard)
|
||||||
*/
|
*/
|
||||||
if (ram_discard_range(mis, block_name, 0, length)) {
|
if (ram_discard_range(block_name, 0, length)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,7 +269,7 @@ static int cleanup_range(const char *block_name, void *host_addr,
|
|||||||
*/
|
*/
|
||||||
int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages)
|
int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages)
|
||||||
{
|
{
|
||||||
if (qemu_ram_foreach_block(init_range, mis)) {
|
if (qemu_ram_foreach_block(init_range, NULL)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -782,7 +782,7 @@ static void ram_release_pages(const char *rbname, uint64_t offset, int pages)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ram_discard_range(NULL, rbname, offset, pages << TARGET_PAGE_BITS);
|
ram_discard_range(rbname, offset, pages << TARGET_PAGE_BITS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1608,7 +1608,7 @@ void ram_postcopy_migrated_memory_release(MigrationState *ms)
|
|||||||
|
|
||||||
while (run_start < range) {
|
while (run_start < range) {
|
||||||
unsigned long run_end = find_next_bit(bitmap, range, run_start + 1);
|
unsigned long run_end = find_next_bit(bitmap, range, run_start + 1);
|
||||||
ram_discard_range(NULL, block->idstr, run_start << TARGET_PAGE_BITS,
|
ram_discard_range(block->idstr, run_start << TARGET_PAGE_BITS,
|
||||||
(run_end - run_start) << TARGET_PAGE_BITS);
|
(run_end - run_start) << TARGET_PAGE_BITS);
|
||||||
run_start = find_next_zero_bit(bitmap, range, run_end + 1);
|
run_start = find_next_zero_bit(bitmap, range, run_end + 1);
|
||||||
}
|
}
|
||||||
@ -1948,15 +1948,12 @@ int ram_postcopy_send_discard_bitmap(MigrationState *ms)
|
|||||||
*
|
*
|
||||||
* Returns zero on success
|
* Returns zero on success
|
||||||
*
|
*
|
||||||
* @mis: current migration incoming state
|
|
||||||
* @rbname: name of the RAMBlock of the request. NULL means the
|
* @rbname: name of the RAMBlock of the request. NULL means the
|
||||||
* same that last one.
|
* same that last one.
|
||||||
* @start: RAMBlock starting page
|
* @start: RAMBlock starting page
|
||||||
* @length: RAMBlock size
|
* @length: RAMBlock size
|
||||||
*/
|
*/
|
||||||
int ram_discard_range(MigrationIncomingState *mis,
|
int ram_discard_range(const char *rbname, uint64_t start, size_t length)
|
||||||
const char *rbname,
|
|
||||||
uint64_t start, size_t length)
|
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
|
@ -1479,8 +1479,7 @@ static int loadvm_postcopy_ram_handle_discard(MigrationIncomingState *mis,
|
|||||||
block_length = qemu_get_be64(mis->from_src_file);
|
block_length = qemu_get_be64(mis->from_src_file);
|
||||||
|
|
||||||
len -= 16;
|
len -= 16;
|
||||||
int ret = ram_discard_range(mis, ramid, start_addr,
|
int ret = ram_discard_range(ramid, start_addr, block_length);
|
||||||
block_length);
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user