From patchwork Tue Aug 10 15:12:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 61396 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 2BA54B6F0D for ; Wed, 11 Aug 2010 01:14:40 +1000 (EST) Received: from localhost ([127.0.0.1]:45270 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiqXF-0007XB-BC for incoming@patchwork.ozlabs.org; Tue, 10 Aug 2010 11:14:37 -0400 Received: from [140.186.70.92] (port=56591 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiqWB-0007W4-AZ for qemu-devel@nongnu.org; Tue, 10 Aug 2010 11:13:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiqWA-00011E-8X for qemu-devel@nongnu.org; Tue, 10 Aug 2010 11:13:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26597) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiqWA-00010t-1N for qemu-devel@nongnu.org; Tue, 10 Aug 2010 11:13:30 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7AFDRkQ023255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 10 Aug 2010 11:13:27 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7AFDRc5017104; Tue, 10 Aug 2010 11:13:27 -0400 Received: from amt.cnet (vpn-9-1.rdu.redhat.com [10.11.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o7AFDQos032238; Tue, 10 Aug 2010 11:13:26 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 4A646656039; Tue, 10 Aug 2010 12:12:28 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o7AFCSLe004055; Tue, 10 Aug 2010 12:12:28 -0300 From: Marcelo Tosatti To: Anthony Liguori Date: Tue, 10 Aug 2010 12:12:05 -0300 Message-Id: <70fedd76d9fe4900651f3360725fb511a19d03d5.1281453126.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Alex Williamson , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 1/2] kvm: Don't walk memory_size == 0 slots in kvm_client_migration_log 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 From: Alex Williamson If we've unregistered a memory area, we should avoid calling qemu_get_ram_ptr() on the left over phys_offset cruft in the slot array. Now that we support removing ramblocks, the phys_offset ram_addr_t can go away and cause a lookup fault and abort. Signed-off-by: Alex Williamson Signed-off-by: Marcelo Tosatti --- kvm-all.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 7635f2f..736c516 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -274,6 +274,9 @@ static int kvm_set_migration_log(int enable) for (i = 0; i < ARRAY_SIZE(s->slots); i++) { mem = &s->slots[i]; + if (!mem->memory_size) { + continue; + } if (!!(mem->flags & KVM_MEM_LOG_DIRTY_PAGES) == enable) { continue; }