Patchwork vhost: Fix address calculation in vhost_dev_sync_region()

login
register
mail settings
Submitter Jason Wang
Date Nov. 27, 2010, 2:05 p.m.
Message ID <20101127140506.16888.96397.stgit@dhcp-91-7.nay.redhat.com.englab.nay.redhat.com>
Download mbox | patch
Permalink /patch/73277/
State New
Headers show

Comments

Jason Wang - Nov. 27, 2010, 2:05 p.m.
We still need advance address even we find there's no dirty pages in
current chunk.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/vhost.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Michael S. Tsirkin - Nov. 28, 2010, 8:10 a.m.
On Sat, Nov 27, 2010 at 10:05:07PM +0800, Jason Wang wrote:
> We still need advance address even we find there's no dirty pages in
> current chunk.
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  hw/vhost.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

Applied, thanks!

> diff --git a/hw/vhost.c b/hw/vhost.c
> index 8586f66..6082da2 100644
> --- a/hw/vhost.c
> +++ b/hw/vhost.c
> @@ -37,6 +37,7 @@ static void vhost_dev_sync_region(struct vhost_dev *dev,
>          /* We first check with non-atomic: much cheaper,
>           * and we expect non-dirty to be the common case. */
>          if (!*from) {
> +            addr += VHOST_LOG_CHUNK;
>              continue;
>          }
>          /* Data must be read atomically. We don't really

Patch

diff --git a/hw/vhost.c b/hw/vhost.c
index 8586f66..6082da2 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -37,6 +37,7 @@  static void vhost_dev_sync_region(struct vhost_dev *dev,
         /* We first check with non-atomic: much cheaper,
          * and we expect non-dirty to be the common case. */
         if (!*from) {
+            addr += VHOST_LOG_CHUNK;
             continue;
         }
         /* Data must be read atomically. We don't really