qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/1] qga: Add 'guest-get-users' command


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 1/1] qga: Add 'guest-get-users' command
Date: Mon, 3 Apr 2017 15:13:04 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 04/03/2017 03:08 PM, Vinzenz 'evilissimo' Feenstra wrote:
> From: Vinzenz Feenstra <address@hidden>
> 
> 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 <address@hidden>
> ---

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]