From patchwork Thu Jun 24 04:42:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 56757 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 55A1CB6EEB for ; Thu, 24 Jun 2010 15:14:16 +1000 (EST) Received: from localhost ([127.0.0.1]:51679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORelR-0000UY-Em for incoming@patchwork.ozlabs.org; Thu, 24 Jun 2010 01:14:13 -0400 Received: from [140.186.70.92] (port=37946 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OReH7-0003jU-Gq for qemu-devel@nongnu.org; Thu, 24 Jun 2010 00:42:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OReH6-0001Wq-1C for qemu-devel@nongnu.org; Thu, 24 Jun 2010 00:42:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24791) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OReH5-0001Wi-PX for qemu-devel@nongnu.org; Thu, 24 Jun 2010 00:42:51 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5O4geIf015329 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 Jun 2010 00:42:40 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5O4gbAj013989; Thu, 24 Jun 2010 00:42:38 -0400 From: Alex Williamson To: qemu-devel@nongnu.org Date: Wed, 23 Jun 2010 22:42:37 -0600 Message-ID: <20100624044237.16168.54671.stgit@localhost.localdomain> In-Reply-To: <20100624044046.16168.32804.stgit@localhost.localdomain> References: <20100624044046.16168.32804.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: jan.kiszka@siemens.com, armbru@redhat.com, alex.williamson@redhat.com, kraxel@redhat.com, cam@cs.ualberta.ca, paul@codesourcery.com Subject: [Qemu-devel] [PATCH 15/15] ramblocks: No more being lazy about duplicate names 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 Now that we have a working qemu_ram_free() and the primary runtime user of it has been updated, don't be lenient about duplicate id strings. We also shouldn't need to create them ondemand at the target. Signed-off-by: Alex Williamson --- arch_init.c | 5 +++-- exec.c | 13 +++---------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/arch_init.c b/arch_init.c index 2f082f3..47bb4b2 100644 --- a/arch_init.c +++ b/arch_init.c @@ -369,8 +369,9 @@ int ram_load(QEMUFile *f, void *opaque, int version_id) } if (!block) { - if (!qemu_ram_alloc(NULL, id, length)) - return -ENOMEM; + fprintf(stderr, "Unknown ramblock \"%s\", cannot " + "accept migration\n", id); + return -EINVAL; } total_ram_bytes -= length; diff --git a/exec.c b/exec.c index e8108d7..ef2a89d 100644 --- a/exec.c +++ b/exec.c @@ -2813,16 +2813,9 @@ ram_addr_t qemu_ram_alloc(DeviceState *dev, const char *name, ram_addr_t size) QLIST_FOREACH(block, &ram_list.blocks, next) { if (!strcmp(block->idstr, new_block->idstr)) { - if (block->length == new_block->length) { - fprintf(stderr, "RAMBlock \"%s\" exists, assuming lack of" - "free.\n", new_block->idstr); - qemu_free(new_block); - return block->offset; - } else { - fprintf(stderr, "RAMBlock \"%s\" already registered with" - "different size, abort\n", new_block->idstr); - abort(); - } + fprintf(stderr, "RAMBlock \"%s\" already registered, abort!\n", + new_block->idstr); + abort(); } }