[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 2/3] qga: add guest-get-time command
From: |
Lei Li |
Subject: |
[Qemu-devel] [PATCH 2/3] qga: add guest-get-time command |
Date: |
Sun, 6 Jan 2013 18:06:59 +0800 |
Signed-off-by: Lei Li <address@hidden>
---
qga/commands-posix.c | 12 ++++++++++++
qga/qapi-schema.json | 17 +++++++++++++++++
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 26b0fa0..190199d 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -109,6 +109,18 @@ static HostTimeInfo *get_host_time(void)
return host_time;
}
+struct HostTimeInfo *qmp_guest_get_time(Error **errp)
+{
+ HostTimeInfo *host_time = get_host_time();
+
+ if (!host_time) {
+ error_set(errp, QERR_QGA_COMMAND_FAILED, "Failed to get host time");
+ return NULL;
+ }
+
+ return host_time;
+}
+
typedef struct GuestFileHandle {
uint64_t id;
FILE *fh;
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 7793aff..4a8b93c 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -100,6 +100,23 @@
'utc-offset': 'int' } }
##
+# @guest-get-time:
+#
+# Get the information about host time in UTC and the
+# UTC offset.
+#
+# This command tries to get the host time which is
+# presumably correct, since need to be able to resynchronize
+# clock to host in guest.
+#
+# Returns: @HostTimeInfo on success.
+#
+# Since 1.4
+##
+{ 'command': 'guest-get-time',
+ 'returns': 'HostTimeInfo' }
+
+##
# @GuestAgentCommandInfo:
#
# Information about guest agent commands.
--
1.7.7.6
- Re: [Qemu-devel] [PATCH 1/3] qga: add support to get host time, (continued)
Re: [Qemu-devel] [PATCH 1/3] qga: add support to get host time, Luiz Capitulino, 2013/01/09
Re: [Qemu-devel] [PATCH 1/3] qga: add support to get host time, mdroth, 2013/01/09
[Qemu-devel] [PATCH 2/3] qga: add guest-get-time command,
Lei Li <=
Re: [Qemu-devel] [PATCH 2/3] qga: add guest-get-time command, Luiz Capitulino, 2013/01/09
[Qemu-devel] [PATCH 3/3] qga: add guest-set-time command, Lei Li, 2013/01/06