]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: @running in qemuMonitorGetStatus is always non-NULL
authorPeter Krempa <pkrempa@redhat.com>
Tue, 14 Apr 2015 15:00:23 +0000 (17:00 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 15 Apr 2015 11:58:26 +0000 (13:58 +0200)
Add the attribute and remove the check.

src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h

index 7155e7fc4d078c3f30f53677e3fcd80840ee76ff..0561d528acaaa429774527625b366279b490c37c 100644 (file)
@@ -1586,9 +1586,9 @@ qemuMonitorGetStatus(qemuMonitorPtr mon,
 {
     VIR_DEBUG("mon=%p, running=%p, reason=%p", mon, running, reason);
 
-    if (!mon || !running) {
+    if (!mon) {
         virReportError(VIR_ERR_INVALID_ARG, "%s",
-                       _("both monitor and running must not be NULL"));
+                       _("monitor must not be NULL"));
         return -1;
     }
 
index 999af10d5e0ad4396c95bb1ceb5ec1a9c341e8df..3e9c43c74d788cd6124c63748437e852cba234d1 100644 (file)
@@ -335,7 +335,8 @@ int qemuMonitorVMStatusToPausedReason(const char *status);
 
 int qemuMonitorGetStatus(qemuMonitorPtr mon,
                          bool *running,
-                         virDomainPausedReason *reason);
+                         virDomainPausedReason *reason)
+    ATTRIBUTE_NONNULL(2);
 
 int qemuMonitorSystemReset(qemuMonitorPtr mon);
 int qemuMonitorSystemPowerdown(qemuMonitorPtr mon);