On 12/01/2015 03:18 PM, Shmulik Ladkani wrote:
Hi,

On Tue, 1 Dec 2015 13:48:13 +0200, mar...@redhat.com wrote:
May I suggest the following:
- Expose 'pci_qdev_realize'
- Have 'virtio_pci_class_init' arm it's own dc->realize,
    which will first set 'QEMU_PCI_CAP_EXPRESS' flag as needed,
    and then call 'pci_qdev_realize'
- Now, in 'virtio_pci_realize' we may use 'pci_is_express' instead of
    directly checking the proxy->flags

If this sounds ok, I'll submit a fix.

Give it a try, sure, but you don't need to expose pci_qdev_realize,
you can 'hijack' parent's realize method before replacing it.

Actually I caught this as I needed to do something very similar to
vmxnet3.

Since we need this in 2 places, I thought it would be better to expose
pci_qdev_realize (maybe name it better) and not store parent's original
realize before replacing it.

WDYT?


Personally I don't think pci_qdev_realize should be visible outside hw/pci/pci.c
because "realize" should be private to object...

However I didn't see yet the vmxnet3 changes you propose. Maybe you can send
an RFC and we'll check then.

Thanks,
Marcel


Reply via email to