diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-09-26 16:14:03 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-09-26 16:14:03 +0100 |
commit | 1329132d28bf14b9508f7a1f04a2c63422bc3f99 (patch) | |
tree | ff1527f32f493e9889ba4dfae5d06fe62380b136 /hw | |
parent | eb13d1cf4a0478fc29f80abfbac8209479325f35 (diff) | |
parent | 3fc4a64cbaed2ddee4c60ddc06740b320e18ab82 (diff) | |
download | qemu-1329132d28bf14b9508f7a1f04a2c63422bc3f99.zip qemu-1329132d28bf14b9508f7a1f04a2c63422bc3f99.tar.gz qemu-1329132d28bf14b9508f7a1f04a2c63422bc3f99.tar.bz2 |
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
vhost: fixes
Misc fixes related to memory region handling.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Wed 25 Sep 2019 15:28:23 BST
# gpg: using RSA key 281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg: aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67
# Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469
* remotes/mst/tags/for_upstream:
vhost: Fix memory region section comparison
memory: Provide an equality function for MemoryRegionSections
memory: Align MemoryRegionSections fields
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/virtio/vhost.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 34accdf..2386b51 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -451,8 +451,13 @@ static void vhost_commit(MemoryListener *listener) changed = true; } else { /* Same size, lets check the contents */ - changed = n_old_sections && memcmp(dev->mem_sections, old_sections, - n_old_sections * sizeof(old_sections[0])) != 0; + for (int i = 0; i < n_old_sections; i++) { + if (!MemoryRegionSection_eq(&old_sections[i], + &dev->mem_sections[i])) { + changed = true; + break; + } + } } trace_vhost_commit(dev->started, changed); |