[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCHv2 5/7] qemu: monitor: @running in qemuMonitorGetStatus is always non-NULL



Add the attribute and remove the check.
---
 src/qemu/qemu_monitor.c | 4 ++--
 src/qemu/qemu_monitor.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index c91a660..20605cd 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -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;
     }

diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 999af10..3e9c43c 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -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);
-- 
2.3.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]