* [Qemu-devel] [PATCH] migration/postcopy: Update the bandwidth during postcopy
@ 2019-03-08 10:12 Dr. David Alan Gilbert (git)
2019-03-11 3:11 ` Peter Xu
0 siblings, 1 reply; 2+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2019-03-08 10:12 UTC (permalink / raw)
To: qemu-devel, peterx, quintela
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
The recently added max-postcopy-bandwidth parameter is only read
at the transition from precopy->postcopy where as the older
max-bandwidth parameter updates the migration bandwidth when changed
even if the migration is already running.
Fix this discrepency so that:
a) You can change the bandwidth during postcopy by setting
max-postcopy-bandwidth
b) Changing max-bandwidth during postcopy has no effect
(it currently changes the postcopy bandwidth which isn't
expected).
Fixes: 7e555c6c
bz: https://bugzilla.redhat.com/show_bug.cgi?id=1686321
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/migration.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/migration/migration.c b/migration/migration.c
index df6fd8e0e5..221f1b9ced 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1347,7 +1347,7 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
if (params->has_max_bandwidth) {
s->parameters.max_bandwidth = params->max_bandwidth;
- if (s->to_dst_file) {
+ if (s->to_dst_file && !migration_in_postcopy()) {
qemu_file_set_rate_limit(s->to_dst_file,
s->parameters.max_bandwidth / XFER_LIMIT_RATIO);
}
@@ -1379,6 +1379,10 @@ static void migrate_params_apply(MigrateSetParameters *params, Error **errp)
}
if (params->has_max_postcopy_bandwidth) {
s->parameters.max_postcopy_bandwidth = params->max_postcopy_bandwidth;
+ if (s->to_dst_file && migration_in_postcopy()) {
+ qemu_file_set_rate_limit(s->to_dst_file,
+ s->parameters.max_postcopy_bandwidth / XFER_LIMIT_RATIO);
+ }
}
if (params->has_max_cpu_throttle) {
s->parameters.max_cpu_throttle = params->max_cpu_throttle;
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] migration/postcopy: Update the bandwidth during postcopy
2019-03-08 10:12 [Qemu-devel] [PATCH] migration/postcopy: Update the bandwidth during postcopy Dr. David Alan Gilbert (git)
@ 2019-03-11 3:11 ` Peter Xu
0 siblings, 0 replies; 2+ messages in thread
From: Peter Xu @ 2019-03-11 3:11 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git); +Cc: qemu-devel, quintela
On Fri, Mar 08, 2019 at 10:12:10AM +0000, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> The recently added max-postcopy-bandwidth parameter is only read
> at the transition from precopy->postcopy where as the older
> max-bandwidth parameter updates the migration bandwidth when changed
> even if the migration is already running.
>
> Fix this discrepency so that:
> a) You can change the bandwidth during postcopy by setting
> max-postcopy-bandwidth
>
> b) Changing max-bandwidth during postcopy has no effect
> (it currently changes the postcopy bandwidth which isn't
> expected).
>
> Fixes: 7e555c6c
> bz: https://bugzilla.redhat.com/show_bug.cgi?id=1686321
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Now in qapi/migration.json it's not mentioning precopy in the
max-bandwidth entry which seems to work even for postcopy but it'll
not:
# @max-bandwidth: to set maximum speed for migration. maximum speed in
# bytes per second. (Since 2.8)
Should we consider to touch that up too to match everything?
--
Peter Xu
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-11 3:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-08 10:12 [Qemu-devel] [PATCH] migration/postcopy: Update the bandwidth during postcopy Dr. David Alan Gilbert (git)
2019-03-11 3:11 ` Peter Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).