Skip to contentSkip to conversation

migration: Rename xbzrle_enabled xbzrle_started

PATCH In review Juan Quintela 3 participants 4 messages May 4, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: Rename xbzrle_enabled xbzrle_started

Otherwise it is confusing with the function xbzrle_enabled().

---
 migration/ram.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
migration/ram.c +7 -7
index 43338e1f5b..06015eeb0b 100644
@@ -388,8 +388,8 @@ struct RAMState {
     uint64_t xbzrle_pages_prev;
     /* Amount of xbzrle encoded bytes since the beginning of the period */
     uint64_t xbzrle_bytes_prev;
-    /* Start using XBZRLE (e.g., after the first round). */
-    bool xbzrle_enabled;
+    /* Are we really  using XBZRLE (e.g., after the first round). */
+    bool xbzrle_started;
     /* Are we on the last stage of migration */
     bool last_stage;
     /* compression statistics since the beginning of the period */
@@ -1420,7 +1420,7 @@ static int ram_save_page(RAMState *rs, PageSearchStatus *pss)
     trace_ram_save_page(block->idstr, (uint64_t)offset, p);
 
     XBZRLE_cache_lock();
-    if (rs->xbzrle_enabled && !migration_in_postcopy()) {
+    if (rs->xbzrle_started && !migration_in_postcopy()) {
         pages = save_xbzrle_page(rs, pss, &p, current_addr,
                                  block, offset);
         if (!rs->last_stage) {
@@ -1636,7 +1636,7 @@ static int find_dirty_block(RAMState *rs, PageSearchStatus *pss)
             pss->complete_round = true;
             /* After the first round, enable XBZRLE. */
             if (migrate_xbzrle()) {
-                rs->xbzrle_enabled = true;
+                rs->xbzrle_started = true;
             }
         }
         /* Didn't find anything this time, but try again on the new block */
@@ -2288,7 +2288,7 @@ static bool save_page_use_compression(RAMState *rs)
      * using the data compression. In theory, xbzrle can do better than
      * compression.
      */
-    if (rs->xbzrle_enabled) {
+    if (rs->xbzrle_started) {
         return false;
     }
 
@@ -2357,7 +2357,7 @@ static int ram_save_target_page_legacy(RAMState *rs, PageSearchStatus *pss)
         /* Must let xbzrle know, otherwise a previous (now 0'd) cached
          * page would be stale
          */
-        if (rs->xbzrle_enabled) {
+        if (rs->xbzrle_started) {
             XBZRLE_cache_lock();
             xbzrle_cache_zero_page(rs, block->offset + offset);
             XBZRLE_cache_unlock();
@@ -2738,7 +2738,7 @@ static void ram_state_reset(RAMState *rs)
     rs->last_seen_block = NULL;
     rs->last_page = 0;
     rs->last_version = ram_list.version;
-    rs->xbzrle_enabled = false;
+    rs->xbzrle_started = false;
 }
 
 #define MAX_WAIT 50 /* ms, half buffered_file limit */
Signature · 1 line
2.40.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Juan Quintela

Otherwise it is confusing with the function xbzrle_enabled().

---
 migration/ram.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
migration/ram.c +0 -0
index 43338e1f5b..06015eeb0b 100644

migration/ram.c struct RAMState { · line 391

Quoted 6 lines
migration/ram.c +1 -2
@@ -388,8 +388,8 @@ struct RAMState {
     uint64_t xbzrle_pages_prev;
     /* Amount of xbzrle encoded bytes since the beginning of the period */
     uint64_t xbzrle_bytes_prev;
-    /* Start using XBZRLE (e.g., after the first round). */
-    bool xbzrle_enabled;
+    /* Are we really  using XBZRLE (e.g., after the first round). */

double spaces

migration/ram.c struct RAMState { · line 392

Quoted 1 line
migration/ram.c +1 -0
+    bool xbzrle_started;
Signature · 1 line
Peter Xu
#2 lore raw
Quoted 9 lines · Peter Xu
Quoted 8 lines · Juan Quintela

Otherwise it is confusing with the function xbzrle_enabled().

---
 migration/ram.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Quoted 13 lines

migration/ram.c struct RAMState { · line 391

Quoted 11 lines
migration/ram.c +1 -2
index 43338e1f5b..06015eeb0b 100644
@@ -388,8 +388,8 @@ struct RAMState {
     uint64_t xbzrle_pages_prev;
     /* Amount of xbzrle encoded bytes since the beginning of the period */
     uint64_t xbzrle_bytes_prev;
-    /* Start using XBZRLE (e.g., after the first round). */
-    bool xbzrle_enabled;
+    /* Are we really  using XBZRLE (e.g., after the first round). */

double spaces

Fixed.

Quoted 4 lines

migration/ram.c struct RAMState { · line 392

Quoted 2 lines
migration/ram.c +1 -0
+    bool xbzrle_started;

Thanks.

Reviewed-by on v1 1/1
#3 lore raw
In reply to Juan Quintela
Quoted 7 lines · Juan Quintela

Otherwise it is confusing with the function xbzrle_enabled().

---
 migration/ram.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|