]> git.proxmox.com Git - qemu.git/commitdiff
ramblocks: No more being lazy about duplicate names
authorAlex Williamson <alex.williamson@redhat.com>
Fri, 2 Jul 2010 17:13:29 +0000 (11:13 -0600)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 6 Jul 2010 15:36:29 +0000 (10:36 -0500)
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 <alex.williamson@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
arch_init.c
exec.c

index 2f082f30bba10fd543c611e786bff9833c713525..47bb4b2d8fc141e4d1fd923baf9848039219a4e2 100644 (file)
@@ -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 b9a14718b884350638d52be9424b5ee12f900ea0..5420f564b58245916c97150229be43e28990319b 100644 (file)
--- 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();
         }
     }