]> git.proxmox.com Git - mirror_qemu.git/commitdiff
memory-device: break the loop if tmp exceed the hinted range
authorWei Yang <richardw.yang@linux.intel.com>
Tue, 30 Jul 2019 00:37:40 +0000 (08:37 +0800)
committerEduardo Habkost <ehabkost@redhat.com>
Tue, 15 Oct 2019 21:18:08 +0000 (18:18 -0300)
The memory-device list built by memory_device_build_list is ordered by
its address, this means if the tmp range exceed the hinted range, all
the following range will not overlap with it.

And this won't change default pc-dimm mapping and address assignment stay
the same as before this change.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Message-Id: <20190730003740.20694-3-richardw.yang@linux.intel.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
hw/mem/memory-device.c

index 5029890e06b21859d0c7a5b2b863c0b675d0acd1..aef148c1d7d01b1ea4a8059520eb1ee9a099da03 100644 (file)
@@ -179,6 +179,8 @@ static uint64_t memory_device_get_free_addr(MachineState *ms,
                 range_make_empty(&new);
                 break;
             }
+        } else if (range_lob(&tmp) > range_upb(&new)) {
+            break;
         }
     }