diff options
author | Laurent Vivier | 2020-06-17 13:31:54 +0200 |
---|---|---|
committer | Dr. David Alan Gilbert | 2020-06-17 18:48:39 +0200 |
commit | 7e89a1401a9674c9882948f05f4d17ea7be1c4eb (patch) | |
tree | 1090373a6623a9362ba18b80f0c8ff349ff39339 /hw/net/cadence_gem.c | |
parent | docs/xbzrle: update 'cache miss rate' and 'encoding rate' to docs (diff) | |
download | qemu-7e89a1401a9674c9882948f05f4d17ea7be1c4eb.tar.gz qemu-7e89a1401a9674c9882948f05f4d17ea7be1c4eb.tar.xz qemu-7e89a1401a9674c9882948f05f4d17ea7be1c4eb.zip |
migration: fix multifd_send_pages() next channel
multifd_send_pages() loops around the available channels,
the next channel to use between two calls to multifd_send_pages() is stored
inside a local static variable, next_channel.
It works well, except if the number of channels decreases between two calls
to multifd_send_pages(). In this case, the loop can try to access the
data of a channel that doesn't exist anymore.
The problem can be triggered if we start a migration with a given number of
channels and then we cancel the migration to restart it with a lower number.
This ends generally with an error like:
qemu-system-ppc64: .../util/qemu-thread-posix.c:77: qemu_mutex_lock_impl: Assertion `mutex->initialized' failed.
This patch fixes the error by capping next_channel with the current number
of channels before using it.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20200617113154.593233-1-lvivier@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'hw/net/cadence_gem.c')
0 files changed, 0 insertions, 0 deletions