From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Alex Williamson 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> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH 15/15] ramblocks: No more being lazy about duplicate names List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jan.kiszka@siemens.com, armbru@redhat.com, alex.williamson@redhat.com, kraxel@redhat.com, cam@cs.ualberta.ca, paul@codesourcery.com 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(); } }