]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: silence Coverity false positive
authorEric Blake <eblake@redhat.com>
Sat, 8 Oct 2011 02:56:00 +0000 (20:56 -0600)
committerEric Blake <eblake@redhat.com>
Sat, 8 Oct 2011 03:00:05 +0000 (21:00 -0600)
Coverity complained that 4 out of 5 callers to virJSONValueObjectGetBoolean
checked for errors.  But we documented that we don't care in this case.

* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBlockInfo): Use
ignore_value.

src/qemu/qemu_monitor_json.c

index c4f8360e9d914f1e2774ad03145cd1ced3df43ea..3d383c825e80c677cef52ada8e47bc2f7d2638ff 100644 (file)
@@ -40,6 +40,7 @@
 #include "datatypes.h"
 #include "virterror_internal.h"
 #include "json.h"
+#include "ignore-value.h"
 
 #define VIR_FROM_THIS VIR_FROM_QEMU
 
@@ -1418,7 +1419,8 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon,
         /* Don't check for success here, because 'tray-open' is presented iff
          * medium is ejected.
          */
-        virJSONValueObjectGetBoolean(dev, "tray-open", &info->tray_open);
+        ignore_value(virJSONValueObjectGetBoolean(dev, "tray-open",
+                                                  &info->tray_open));
 
         break;
     }