]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Add non-null annotations to qemuMonitorOpen
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 20 Aug 2012 12:39:47 +0000 (13:39 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 7 Sep 2012 12:18:00 +0000 (13:18 +0100)
Add some non-null annotations to qemuMonitorOpen and also
check that the error callback is set, since it is mandatory

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h

index 6ce18393b728af8febdc39ac9e3357dacaa3a8d2..290f1503ff141135b5fc6fb391097503e794ef58 100644 (file)
@@ -683,11 +683,16 @@ qemuMonitorOpen(virDomainObjPtr vm,
 {
     qemuMonitorPtr mon;
 
-    if (!cb || !cb->eofNotify) {
+    if (!cb->eofNotify) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("EOF notify callback must be supplied"));
         return NULL;
     }
+    if (!cb->errorNotify) {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("Error notify callback must be supplied"));
+        return NULL;
+    }
 
     if (qemuMonitorInitialize() < 0)
         return NULL;
index ad8d2f1afe31a553b3e39fa670bd2fa4077b87bf..2033473beea3840175162cbc6ca7f857eff7740e 100644 (file)
@@ -145,7 +145,8 @@ char *qemuMonitorUnescapeArg(const char *in);
 qemuMonitorPtr qemuMonitorOpen(virDomainObjPtr vm,
                                virDomainChrSourceDefPtr config,
                                int json,
-                               qemuMonitorCallbacksPtr cb);
+                               qemuMonitorCallbacksPtr cb)
+    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
 
 void qemuMonitorClose(qemuMonitorPtr mon);