From patchwork Sat Nov 27 14:05:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 73277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 96ECAB70E0 for ; Sun, 28 Nov 2010 01:04:35 +1100 (EST) Received: from localhost ([127.0.0.1]:51736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PMLOB-0002WL-F6 for incoming@patchwork.ozlabs.org; Sat, 27 Nov 2010 09:04:31 -0500 Received: from [140.186.70.92] (port=41278 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PMLNj-0002UP-8r for qemu-devel@nongnu.org; Sat, 27 Nov 2010 09:04:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PMLNh-0000NK-Mv for qemu-devel@nongnu.org; Sat, 27 Nov 2010 09:04:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PMLNh-0000N5-GB for qemu-devel@nongnu.org; Sat, 27 Nov 2010 09:04:01 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oARE3xmo030766 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 27 Nov 2010 09:03:59 -0500 Received: from dhcp-91-7.nay.redhat.com.englab.nay.redhat.com (dhcp-91-7.nay.redhat.com [10.66.91.7]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oARE3unN004666; Sat, 27 Nov 2010 09:03:58 -0500 To: qemu-devel@nongnu.org, mst@redhat.com From: Jason Wang Date: Sat, 27 Nov 2010 22:05:07 +0800 Message-ID: <20101127140506.16888.96397.stgit@dhcp-91-7.nay.redhat.com.englab.nay.redhat.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] vhost: Fix address calculation in vhost_dev_sync_region() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org We still need advance address even we find there's no dirty pages in current chunk. Signed-off-by: Jason Wang --- hw/vhost.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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