qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

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

+1 -2
+1 -2
hw/pci/pci.c
··· 2235 2235 snprintf(name, sizeof(name), "%s.rom", object_get_typename(OBJECT(pdev))); 2236 2236 } 2237 2237 pdev->has_rom = true; 2238 - memory_region_init_rom_nomigrate(&pdev->rom, OBJECT(pdev), name, size, &error_fatal); 2239 - vmstate_register_ram(&pdev->rom, &pdev->qdev); 2238 + memory_region_init_rom(&pdev->rom, OBJECT(pdev), name, size, &error_fatal); 2240 2239 ptr = memory_region_get_ram_ptr(&pdev->rom); 2241 2240 load_image(path, ptr); 2242 2241 g_free(path);