On 04/03/2017 03:08 PM, Vinzenz 'evilissimo' Feenstra wrote: > From: Vinzenz Feenstra <vfeen...@redhat.com> > > A command that will list all currently logged in users, and the time > since when they are logged in. > > Examples: > > virsh # qemu-agent-command F25 '{ "execute": "guest-get-users" }' > {"return":[{"login-time":1490622289.903835,"user":"root"}]} > > virsh # qemu-agent-command Win2k12r2 '{ "execute": "guest-get-users" }' > {"return":[{"login-time":1490351044.670552,"domain":"LADIDA", > "user":"Administrator"}]} > > Signed-off-by: Vinzenz Feenstra <vfeen...@redhat.com> > ---
I'll leave the code reviews for others (I'm not comfortable enough with Windows API programming), but focus on the interface here: > +++ b/qga/qapi-schema.json > @@ -1042,3 +1042,25 @@ > 'data': { 'path': 'str', '*arg': ['str'], '*env': ['str'], > '*input-data': 'str', '*capture-output': 'bool' }, > 'returns': 'GuestExec' } > + > +## > +# @GuestUser: > +# @user: Username > +# @domain: Logon domain (windows only) > +# @login-time: Unix timestamp of login In what unit? (Fractional) seconds since 1 Jan 1970? So this is when they connected, and not a duration of how long they have been logged on since then. > +# > +# Since: 2.10 > +## > +{ 'struct': 'GuestUser', > + 'data': { 'user': 'str', 'login-time': 'number', '*domain': 'str' } } > + > +## > +# @guest-get-users: > +# Retrieves a list of currently active users on the VM. > +# > +# Returns: A unique list of users. > +# > +# Since: 2.10 > +## > +{ 'command': 'guest-get-users', > + 'returns': ['GuestUser'] } > The API looks good once you add that additional documentation. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature