]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Remove NONNULL(1) for virHostdevPrepareDomainDevices
authorJohn Ferlan <jferlan@redhat.com>
Tue, 21 Mar 2017 18:32:01 +0000 (14:32 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 22 Mar 2017 17:50:00 +0000 (13:50 -0400)
Since the code checks 'mgr == NULL' anyway, no need for the prototype
to have the NONNULL arg check.  Also add an error message to indicate what
the failure is so that there isn't a failed for some reason error.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/util/virhostdev.c
src/util/virhostdev.h

index fc0ebcb39443f1dc713550626ec91a10f446489e..a75d108f7351b4d7085555c88387824a8dd2f5b2 100644 (file)
@@ -1873,8 +1873,11 @@ virHostdevPrepareDomainDevices(virHostdevManagerPtr mgr,
     if (!def->nhostdevs)
         return 0;
 
-    if (mgr == NULL)
+    if (!mgr) {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("no host device manager defined"));
         return -1;
+    }
 
     if (flags & VIR_HOSTDEV_SP_PCI) {
         if (virHostdevPreparePCIDevices(mgr, driver,
index 43ba705b0f881b674d69483aad8f90e58e8dcc29..7ee0b43331200c3bed89ec9acf1a600b193ae486 100644 (file)
@@ -157,7 +157,7 @@ virHostdevPrepareDomainDevices(virHostdevManagerPtr mgr,
                                const char *driver,
                                virDomainDefPtr def,
                                unsigned int flags)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+    ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
 void
 virHostdevReAttachDomainDevices(virHostdevManagerPtr mgr,
                                 const char *driver,