]> git.proxmox.com Git - mirror_qemu.git/commit
memory-device: Refactor memory_device_pre_plug()
authorDavid Hildenbrand <david@redhat.com>
Fri, 23 Jun 2023 12:45:52 +0000 (14:45 +0200)
committerDavid Hildenbrand <david@redhat.com>
Wed, 12 Jul 2023 07:25:37 +0000 (09:25 +0200)
commitd7f4891c85886efde88e0893ec19f89a9d14138e
tree4721a4ca1a77aa46e8e33b0bbdf3f7b8fb666b28
parenta8e67ce35b74e8bec70d39f86886439208c7b645
memory-device: Refactor memory_device_pre_plug()

Let's move memory_device_check_addable() and basic checks out of
memory_device_get_free_addr() directly into memory_device_pre_plug().

Separating basic checks from address assignment is cleaner and
prepares for further changes.

As all memory device users now use memory_devices_init(), and that
function enforces that the size is 0, we can drop the check for an empty
region.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20230623124553.400585-10-david@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
hw/mem/memory-device.c