]> git.proxmox.com Git - qemu.git/commit
vhost: Fix size of dirty log sync on resize
authorAlex Williamson <alex.williamson@redhat.com>
Fri, 13 Aug 2010 13:54:52 +0000 (09:54 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 11 Apr 2012 10:19:32 +0000 (13:19 +0300)
commite314672a8a95f5dc98534f0682fce50fb83dbc5c
tree9698afa313ed2fe49e1922ef7a431d8717aa6996
parentd6c730086cbf24382eb8cff25551798769edfd84
vhost: Fix size of dirty log sync on resize

When the vhost log is resized, we want to sync up to
the size of the old log.  With that end address in place,
ignore regions that start after then end rather than
hitting assert.

This also addresses the following crash report:
When migrating a vm using vhost-net we hit the following assertion:

qemu-kvm: /usr/src/packages/BUILD/qemu-kvm-0.15.1/hw/vhost.c:30:
vhost_dev_sync_region: Assertion `start / (0x1000 * (8 *
sizeof(vhost_log_chunk_t))) < dev->log_size' failed.

The cases which the end < start check is intended to catch, such as
for vga video memory, will also likely trigger the assertion.
Reorder the code to handle this correctly.

Reported-by: Josh Durgin <josh.durgin@dreamhost.com>
Signed-off-by: Bruce Rogers <brogers@suse.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/vhost.c