OSDN Git Service

hw/i386/pc: Use machine_memory_devices_init()
authorDavid Hildenbrand <david@redhat.com>
Fri, 23 Jun 2023 12:45:49 +0000 (14:45 +0200)
committerDavid Hildenbrand <david@redhat.com>
Wed, 12 Jul 2023 07:25:37 +0000 (09:25 +0200)
commit78732a765986d5270d6b3d88afeb9e4d33092360
tree03dc4d76c9bfb11f074edfa82a20982edfdc34b4
parentb13e115ff497581c60c94d4afca33225b1f69faf
hw/i386/pc: Use machine_memory_devices_init()

Let's use our new helper and stop always allocating ms->device_memory.
Once allcoated, we're sure that the size > 0 and that the base was
initialized.

Adjust the code in pc_memory_init() to check for machine->device_memory
instead of pcmc->has_reserved_memory and machine->device_memory->base.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Eduardo Habkost <eduardo@habkost.net>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20230623124553.400585-7-david@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
hw/i386/pc.c