From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tsxt0-0003Ly-2z for qemu-devel@nongnu.org; Wed, 09 Jan 2013 10:48:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tsxsu-0004zv-Jk for qemu-devel@nongnu.org; Wed, 09 Jan 2013 10:48:14 -0500 Received: from mail-ie0-f175.google.com ([209.85.223.175]:55568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tsxsu-0004zg-DX for qemu-devel@nongnu.org; Wed, 09 Jan 2013 10:48:08 -0500 Received: by mail-ie0-f175.google.com with SMTP id qd14so2266563ieb.34 for ; Wed, 09 Jan 2013 07:48:07 -0800 (PST) Sender: fluxion Date: Wed, 9 Jan 2013 09:36:37 -0600 From: mdroth Message-ID: <20130109153637.GA1543@vm> References: <1357466820-12860-1-git-send-email-lilei@linux.vnet.ibm.com> <1357466820-12860-2-git-send-email-lilei@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1357466820-12860-2-git-send-email-lilei@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH 1/3] qga: add support to get host time List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lei Li Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On Sun, Jan 06, 2013 at 06:06:58PM +0800, Lei Li wrote: > Signed-off-by: Lei Li > --- > qga/commands-posix.c | 18 ++++++++++++++++++ > qga/qapi-schema.json | 17 +++++++++++++++++ > 2 files changed, 35 insertions(+), 0 deletions(-) > > diff --git a/qga/commands-posix.c b/qga/commands-posix.c > index a657201..26b0fa0 100644 > --- a/qga/commands-posix.c > +++ b/qga/commands-posix.c > @@ -91,6 +91,24 @@ exit_err: > error_set(err, QERR_UNDEFINED_ERROR); > } > > +static HostTimeInfo *get_host_time(void) > +{ Should squash this into patch #2, since it doesn't get used till then. Otherwise we'll break build bisection when compiling with -Wunused/-Wall && -Werror, which is usually the default. > + int err; > + qemu_timeval tq; > + HostTimeInfo *host_time; > + > + err = qemu_gettimeofday(&tq); > + if (err < 0) { > + return NULL; > + } > + > + host_time = g_malloc0(sizeof(HostTimeInfo)); > + host_time->seconds = tq.tv_sec; > + host_time->microseconds = tq.tv_usec; > + > + return host_time; > +} > + > typedef struct GuestFileHandle { > uint64_t id; > FILE *fh; > diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json > index ed0eb69..7793aff 100644 > --- a/qga/qapi-schema.json > +++ b/qga/qapi-schema.json > @@ -83,6 +83,23 @@ > { 'command': 'guest-ping' } > > ## > +# @HostTimeInfo > +# > +# Information about host time. > +# > +# @seconds: "seconds" time from the host. > +# > +# @microseconds: "microseconds" time from the host. > +# > +# @utc-offset: information about utc offset. > +# > +# Since: 1.4 > +## > +{ 'type': 'HostTimeInfo', > + 'data': { 'seconds': 'int', 'microseconds': 'int', > + 'utc-offset': 'int' } } > + > +## > # @GuestAgentCommandInfo: > # > # Information about guest agent commands. > -- > 1.7.7.6 >