From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtZOH-0006dh-JZ for qemu-devel@nongnu.org; Fri, 11 Jan 2013 02:51:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtZOD-0007Pd-RP for qemu-devel@nongnu.org; Fri, 11 Jan 2013 02:51:01 -0500 Received: from e23smtp03.au.ibm.com ([202.81.31.145]:39580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtZOD-0007P1-7l for qemu-devel@nongnu.org; Fri, 11 Jan 2013 02:50:57 -0500 Received: from /spool/local by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 11 Jan 2013 17:45:59 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id D83323578023 for ; Fri, 11 Jan 2013 18:50:48 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r0B7olVf63701102 for ; Fri, 11 Jan 2013 18:50:48 +1100 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r0B7olYi008757 for ; Fri, 11 Jan 2013 18:50:48 +1100 Message-ID: <50EFC455.10103@linux.vnet.ibm.com> Date: Fri, 11 Jan 2013 15:50:45 +0800 From: Lei Li MIME-Version: 1.0 References: <1357466820-12860-1-git-send-email-lilei@linux.vnet.ibm.com> <1357466820-12860-3-git-send-email-lilei@linux.vnet.ibm.com> <20130109113346.2ab2050d@doriath.home> In-Reply-To: <20130109113346.2ab2050d@doriath.home> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] qga: add guest-get-time command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On 01/09/2013 09:33 PM, Luiz Capitulino wrote: > On Sun, 6 Jan 2013 18:06:59 +0800 > Lei Li wrote: > >> Signed-off-by: Lei Li >> --- >> 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(); > The command is called guest_get_time() and runs in the guest, but it returns > HostTimeInfo. Is this correct? Okay, looks like this 'HostTimeInfo' brings a lots of confusion. I will change it to 'TimeInfo' as I replied to another patch. >> + >> + 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. -- Lei