[libvirt] [PATCH 2/2] qemu_monitor_json: Drop timestamp from command object

Daniel Veillard veillard at redhat.com
Mon Apr 12 12:25:25 UTC 2010


On Fri, Apr 09, 2010 at 04:31:43PM -0300, Luiz Capitulino wrote:
> It's not needed and is just discarded by the Server.
> 
> Signed-off-by: Luiz Capitulino <lcapitulino at redhat.com>
> ---
>  src/qemu/qemu_monitor_json.c |   34 ----------------------------------
>  1 files changed, 0 insertions(+), 34 deletions(-)
> 
> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index 2904201..50de240 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -356,37 +356,6 @@ qemuMonitorJSONHasError(virJSONValuePtr reply,
>      return STREQ(klass, thisklass);
>  }
>  
> -static int
> -qemuMonitorJSONCommandAddTimestamp(virJSONValuePtr obj)
> -{
> -    struct timeval tv;
> -    virJSONValuePtr timestamp = NULL;
> -
> -    if (gettimeofday(&tv, NULL) < 0) {
> -        virReportSystemError(errno, "%s",
> -                             _("cannot query time of day"));
> -        return -1;
> -    }
> -
> -    if (!(timestamp = virJSONValueNewObject()))
> -        goto no_memory;
> -
> -    if (virJSONValueObjectAppendNumberLong(timestamp, "seconds", tv.tv_sec) < 0)
> -        goto no_memory;
> -    if (virJSONValueObjectAppendNumberLong(timestamp, "microseconds", tv.tv_usec) < 0)
> -        goto no_memory;
> -
> -    if (virJSONValueObjectAppend(obj, "timestamp", timestamp) < 0)
> -        goto no_memory;
> -
> -    return 0;
> -
> -no_memory:
> -    virReportOOMError();
> -    virJSONValueFree(timestamp);
> -    return -1;
> -}
> -
>  static virJSONValuePtr ATTRIBUTE_SENTINEL
>  qemuMonitorJSONMakeCommand(const char *cmdname,
>                             ...)
> @@ -404,9 +373,6 @@ qemuMonitorJSONMakeCommand(const char *cmdname,
>      if (virJSONValueObjectAppendString(obj, "execute", cmdname) < 0)
>          goto no_memory;
>  
> -    if (qemuMonitorJSONCommandAddTimestamp(obj) < 0)
> -        goto error;
> -
>      while ((key = va_arg(args, char *)) != NULL) {
>          int ret;
>          char type;

  If it's really useless, okay, but I would prefer to push this after
the 0.8.0 release, just for extra safety :-)

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list