Skip to contentSkip to conversation

migration: use s->threshold_size inside migration_update_counters

PATCH Superseded Wei Wang 2 participants 4 messages Jan 16, 2018 – Jan 17, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wei Wang

author
#0 lore raw

PATCH 1/1 migration: use s->threshold_size inside migration_update_counters

The threshold size is changed to be recorded in s->threshold_size by commit b15df1ae5063c7c181f8f068f9eba7661b3b5e1.

---
 migration/migration.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
migration/migration.c +2 -3
index d3a1c49..bfd1a16 100644
@@ -2212,7 +2212,6 @@ static void migration_update_counters(MigrationState *s,
                                       int64_t current_time)
 {
     uint64_t transferred, time_spent;
-    int64_t threshold_size;
     double bandwidth;
 
     if (current_time < s->iteration_start_time + BUFFER_DELAY) {
@@ -2222,7 +2221,7 @@ static void migration_update_counters(MigrationState *s,
     transferred = qemu_ftell(s->to_dst_file) - s->iteration_initial_bytes;
     time_spent = current_time - s->iteration_start_time;
     bandwidth = (double)transferred / time_spent;
-    threshold_size = bandwidth * s->parameters.downtime_limit;
+    s->threshold_size = bandwidth * s->parameters.downtime_limit;
 
     s->mbps = (((double) transferred * 8.0) /
                ((double) time_spent / 1000.0)) / 1000.0 / 1000.0;
@@ -2242,7 +2241,7 @@ static void migration_update_counters(MigrationState *s,
     s->iteration_initial_bytes = qemu_ftell(s->to_dst_file);
 
     trace_migrate_transferred(transferred, time_spent,
-                              bandwidth, threshold_size);
+                              bandwidth, s->threshold_size);
 }
 
 /* Migration thread iteration status */
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Wei Wang

The threshold size is changed to be recorded in s->threshold_size by commit b15df1ae5063c7c181f8f068f9eba7661b3b5e1.

Could you help confirm the commit ID? Since what I see is b15df1ae50. Otherwise:

And I'd prefer add:

Fixes b15df1ae50 ("migration: cleanup stats update into function")

Thanks for the patch!

Signature · 1 line
Peter Xu
author
#2 lore raw
Quoted 8 lines · Peter Xu
Quoted 4 lines · Wei Wang

The threshold size is changed to be recorded in s->threshold_size by commit b15df1ae5063c7c181f8f068f9eba7661b3b5e1.

Could you help confirm the commit ID? Since what I see is b15df1ae50. Otherwise:

Quoted 8 lines

And I'd prefer add:

Fixes b15df1ae50 ("migration: cleanup stats update into function")

Thanks for the patch!

Sure. b15df1ae50 is shortcut and works too. Agree with your change.

Best,
Wei

#3 lore raw
Quoted 11 lines · Wei Wang
Quoted 10 lines · Peter Xu
Quoted 4 lines · Wei Wang

The threshold size is changed to be recorded in s->threshold_size by commit b15df1ae5063c7c181f8f068f9eba7661b3b5e1.

Could you help confirm the commit ID? Since what I see is b15df1ae50. Otherwise:

Quoted 8 lines
Quoted 6 lines

And I'd prefer add:

Fixes b15df1ae50 ("migration: cleanup stats update into function")

Thanks for the patch!

Sure. b15df1ae50 is shortcut and works too. Agree with your change.

Ouch. I wasn't taking about shortcut or not... I must have pasted a wrong commit ID of yours. Please forget that. :)

Signature · 1 line
Peter Xu