On Sat, May 10, 2025 at 08:08:02AM +0200, Markus Armbruster wrote: > Daniel P. Berrangé <berra...@redhat.com> writes: > > > On Fri, May 09, 2025 at 03:43:30PM +0200, Markus Armbruster wrote: > >> Daniel P. Berrangé <berra...@redhat.com> writes: > >> > Even if we had a QAPI schema that didn't vary per target, this is > >> > repeated probing is tricky to avoid when we have completely independant > >> > binaries. We would need QEMU to have some internal "build id", so that > >> > we could detect that all binaries came from the same build, to let us > >> > avoid re-probing each binary. > >> > >> Back when I created QAPI/QMP introspection, I floated the idea to put > >> something into the QMP greeting to enable safe caching. Libvirt > >> developers told me they didn't need that. I don't remember the details, > >> but I guess the cache invalidation they already had was deemed good > >> enough. > > > > I don't recall that discussion, but I would think the problem is > > that we probe much more than just QMP schema. Actually thinking > > about it, the fact that we probe more than just QMP schema means > > my idea of probing once and getting the answer for all targets > > may not be practical. Some of the query-xxx commands we run will > > likely need to know the target. > > Yes. > > We could split the cache along validity conditions. Possibly worth the > extra complexity if expensive probes then live longer in their cache. > > I'd love to have a list of probes libvirt runs and why.
We don't record the 'why' I'm afraid, so answer the 'why' is pretty much a case of having to read the code :-( The list of probes is also somewhat metadata driven, starting from: https://gitlab.com/libvirt/libvirt/-/blob/6ff8d08777ebbcb9a1e11534c3a3341fbf0343e8/src/qemu/qemu_capabilities.c?page=6#L5718 you would have to then work backwards for each virQMEUCapsProbeQMP method we call. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|