]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
QEmu JSON drop timestamp from command object
authorLuiz Capitulino <lcapitulino@redhat.com>
Fri, 23 Apr 2010 16:06:18 +0000 (18:06 +0200)
committerDaniel Veillard <veillard@redhat.com>
Fri, 23 Apr 2010 16:06:18 +0000 (18:06 +0200)
It's not needed and is currently ignored, but this is a bug.

It will get fixed soon and QMP will return an error for keys
it doesn't know about, this will break libvirt.

* src/qemu/qemu_monitor_json.c: remove qemuMonitorJSONCommandAddTimestamp()
  and the place where it's invoked in qemuMonitorJSONMakeCommand()

src/qemu/qemu_monitor_json.c

index 96f246f5bb38e3ff68d047d9edd343077233e765..7c8387d4889d98aa53b1962f02119b83ce7706b9 100644 (file)
@@ -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;