From patchwork Fri Jul 2 17:13:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 57720 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 0B3A41007DA for ; Sat, 3 Jul 2010 04:02:36 +1000 (EST) Received: from localhost ([127.0.0.1]:39060 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUkZN-0000Ll-7x for incoming@patchwork.ozlabs.org; Fri, 02 Jul 2010 14:02:33 -0400 Received: from [140.186.70.92] (port=43075 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUjnx-00045l-Um for qemu-devel@nongnu.org; Fri, 02 Jul 2010 13:13:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUjnw-0007Ud-Nb for qemu-devel@nongnu.org; Fri, 02 Jul 2010 13:13:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47107) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUjnw-0007UZ-Fg for qemu-devel@nongnu.org; Fri, 02 Jul 2010 13:13:32 -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 o62HDUaO028847 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 2 Jul 2010 13:13:31 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o62HDUHx021816; Fri, 2 Jul 2010 13:13:30 -0400 From: Alex Williamson To: qemu-devel@nongnu.org Date: Fri, 02 Jul 2010 11:13:29 -0600 Message-ID: <20100702171329.30243.3429.stgit@localhost.localdomain> In-Reply-To: <20100702171054.30243.19599.stgit@localhost.localdomain> References: <20100702171054.30243.19599.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 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@redhat.com Subject: [Qemu-devel] [PATCH v3 16/16] 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 b9a1471..5420f56 100644 --- a/exec.c +++ b/exec.c @@ -2826,16 +2826,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(); } }