diff options
author | Vinzenz Feenstra <vfeenstr@redhat.com> | 2017-04-19 11:26:15 +0200 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2017-04-26 23:57:45 -0500 |
commit | 161a56a9065feb6fa2f69cec6237a5c4e714b9d3 (patch) | |
tree | e1c26dd740444144d8d0f92f2e7726b51b4d8777 /include/glib-compat.h | |
parent | 1dbfbc17fe783e34644daf4abbb8f4e17344abcd (diff) |
qga: Add 'guest-get-users' command
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 <vfeenstr@redhat.com>
* make g_hash_table_contains compat func inline to avoid
unused warnings
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'include/glib-compat.h')
-rw-r--r-- | include/glib-compat.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/glib-compat.h b/include/glib-compat.h index 863c8cf73d..fcffcd3f07 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -217,6 +217,12 @@ static inline void g_hash_table_add(GHashTable *hash_table, gpointer key) { g_hash_table_replace(hash_table, key, key); } + +static inline gboolean g_hash_table_contains(GHashTable *hash_table, + gpointer key) +{ + return g_hash_table_lookup_extended(hash_table, key, NULL, NULL); +} #endif #ifndef g_assert_true |