return 1;
}
-static bool save_page_use_compression(RAMState *rs);
-
static int send_queued_data(CompressParam *param)
{
PageSearchStatus *pss = &ram_state->pss[RAM_CHANNEL_PRECOPY];
return len;
}
-static void ram_flush_compressed_data(RAMState *rs)
+static void ram_flush_compressed_data(void)
{
- if (!save_page_use_compression(rs)) {
+ if (!migrate_compress()) {
return;
}
* Also If xbzrle is on, stop using the data compression at this
* point. In theory, xbzrle can do better than compression.
*/
- ram_flush_compressed_data(rs);
+ ram_flush_compressed_data();
/* Hit the end of the list */
pss->block = QLIST_FIRST_RCU(&ram_list.blocks);
return 0;
}
-static bool save_page_use_compression(RAMState *rs)
-{
- if (!migrate_compress()) {
- return false;
- }
-
- /*
- * If xbzrle is enabled (e.g., after first round of migration), stop
- * using the data compression. In theory, xbzrle can do better than
- * compression.
- */
- if (rs->xbzrle_started) {
- return false;
- }
-
- return true;
-}
-
/*
* try to compress the page before posting it out, return true if the page
* has been properly handled by compression, otherwise needs other
static bool save_compress_page(RAMState *rs, PageSearchStatus *pss,
ram_addr_t offset)
{
- if (!save_page_use_compression(rs)) {
+ if (!migrate_compress()) {
return false;
}
* much CPU resource.
*/
if (pss->block != pss->last_sent_block) {
- ram_flush_compressed_data(rs);
+ ram_flush_compressed_data();
return false;
}
* page is sent in one chunk.
*/
if (migrate_postcopy_ram()) {
- ram_flush_compressed_data(rs);
+ ram_flush_compressed_data();
}
/*
}
qemu_mutex_unlock(&rs->bitmap_mutex);
- ram_flush_compressed_data(rs);
+ ram_flush_compressed_data();
int ret = rdma_registration_stop(f, RAM_CONTROL_FINISH);
if (ret < 0) {