* Anthony Liguori<anthony@xxxxxxxxxxxxx> wrote:
Well, in a sense a guest is a KVM concept too: it's in essence represented via- Easy default reference to guest instances, and a way for tools toA guest is not a KVM concept. [...]
reference them symbolically as well in the multi-guest case. Preferably
something trustable and kernel-provided - not some indirect information
like a PID file created by libvirt-manager or so.
the 'vcpu state attached to a struct mm' abstraction that is attached to the
/dev/kvm file descriptor attached to a Linux process.
Multiple vcpus can be started by the same process to represent SMP, but the
whole guest notion is present: a Linux MM that carries KVM state.
In that sense when we type 'perf kvm list' we'd like to get a list of all
currently present guests that the developer has permission to profile: i.e.
we'd like a list of all [debuggable] Linux tasks that have a KVM instance
attached to them.
A convenient way to do that would be to use the Qemu process's ->comm[] name,
and to have a KVM ioctl that gets us a list of all vcpus that the querying
task has ptrace permission to. [the standard permission check we do for
instrumentation]
No need for communication with Qemu for that - just an ioctl, and an
always-guaranteed result that works fine on a whole-system and on a per user
basis as well.
Thanks,
Ingo