On 9/26/25 9:26 AM, Michael S. Tsirkin wrote: > On Fri, Sep 26, 2025 at 12:55:11PM +0800, Jason Wang wrote: >>>> Looking at this, it's nothing admin virtqueue specific, I wonder why >>>> it is not part of virtio_config_ops. >>>> >>>> Thanks >>> >>> cap things are admin commands. But what I do not get is why they >>> need to be callbacks. >>> >>> The only thing about admin commands that is pci specific is finding >>> the admin vq. >> >> I think we had a discussion to decide to separate admin commands from >> the admin vq. >> >> Thanks > > If what you are saying is that core should expose APIs to > submit admin commands, not to access admin vq, I think I agree. >
Quick overview of what I did, to not waste a v4 if you don't agree. Added config_ops->admin_cmd_exec. virtio_pci_modern registers virtio_pci_modern_admin_cmd_exec to it. Moved the logic that had been in virtio_pci_modern for building the commands and returning the data to a new file file virtio_admin_commands.c. That file has the 5 functions needed for cap and object creation.
