diff options
author | Peter Maydell | 2017-07-07 16:42:55 +0200 |
---|---|---|
committer | Peter Maydell | 2017-07-14 18:59:42 +0200 |
commit | fefa92565f9a032dce974a0a6e1f296d449498f3 (patch) | |
tree | 89f991aaa840b748f8eacaaa7177f36e9405238d /hw/pci/pci.c | |
parent | hw/block/pflash_cfi01, pflash_cfi02: Use memory_region_init_rom_device() (diff) | |
download | qemu-fefa92565f9a032dce974a0a6e1f296d449498f3.tar.gz qemu-fefa92565f9a032dce974a0a6e1f296d449498f3.tar.xz qemu-fefa92565f9a032dce974a0a6e1f296d449498f3.zip |
hw/pci/pci.c: Use memory_region_init_rom()
Since we pass the same DeviceState object to
memory_region_init_rom_nomigrate() and vmstate_register_ram(), we can
switch to using memory_region_init_rom() instead.
(This isn't entirely obvious from the code since it is using
&pdev->qdev rather than DEVICE(pdov) for some reason, but
PCIDevice does indeed use 'qdev' for its parent DeviceState member.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1499438577-7674-10-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'hw/pci/pci.c')
-rw-r--r-- | hw/pci/pci.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c index e73279a0c9..258fbe51e2 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2235,8 +2235,7 @@ static void pci_add_option_rom(PCIDevice *pdev, bool is_default_rom, snprintf(name, sizeof(name), "%s.rom", object_get_typename(OBJECT(pdev))); } pdev->has_rom = true; - memory_region_init_rom_nomigrate(&pdev->rom, OBJECT(pdev), name, size, &error_fatal); - vmstate_register_ram(&pdev->rom, &pdev->qdev); + memory_region_init_rom(&pdev->rom, OBJECT(pdev), name, size, &error_fatal); ptr = memory_region_get_ram_ptr(&pdev->rom); load_image(path, ptr); g_free(path); |