]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix some wrong usage of ATTRIBUTE_NONNULL()
authorBihong Yu <yubihong@huawei.com>
Sat, 6 Jun 2020 10:52:35 +0000 (18:52 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 9 Jun 2020 09:39:07 +0000 (11:39 +0200)
The virStateInitialize() function has ATTRIBUTE_NONNULL()
referring to @root argument (incorrectly anyway) but in
daemonRunStateInit() NULL is passed in anyway.

Then there is virCommandAddArgPair() which also has
ATTRIBUTE_NONNULL() for one of its arguments and then checks the
argument for being NULL anyways.

Signed-off-by:Bihong Yu <yubihong@huawei.com>
Reviewed-by:Chuan Zheng <zhengchuan@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/libvirt_internal.h
src/util/vircommand.h

index 00ef7aaf2585a962f9972bd0004b9bd8967ddaae..72c61274a74ea4f17582d3f77b68d3d691647ae2 100644 (file)
@@ -33,8 +33,7 @@ int virStateInitialize(bool privileged,
                        bool mandatory,
                        const char *root,
                        virStateInhibitCallback inhibit,
-                       void *opaque)
-    ATTRIBUTE_NONNULL(2);
+                       void *opaque);
 int virStateCleanup(void);
 int virStateReload(void);
 int virStateStop(void);
index ff8a785dbe26982eda34dc199fc754f414b5355f..e12c88bcc38c90a657b63238213124924aeac402 100644 (file)
@@ -126,8 +126,7 @@ void virCommandAddArgFormat(virCommandPtr cmd,
 
 void virCommandAddArgPair(virCommandPtr cmd,
                           const char *name,
-                          const char *val)
-    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+                          const char *val);
 
 void virCommandAddArgSet(virCommandPtr cmd,
                          const char *const*vals) ATTRIBUTE_NONNULL(2);