util: Sanitize ATTRIBUTE_NONNULL use in viriscsi.h

Some of the function attributes marked as nonnull actually explicitly
handle the arguments for NULL. All changed functions handle missing
"initiatoriqn" argument well and virISCSIScanTargets also handles well
if the return pointers are missing. Remove some of the liberaly used
ATTRIBUTE_NONNULLs as coverity and possibly other compilers that honor
the attribute fail to compile the code.

Flaw introduced in commit 5e1d5dde
This commit is contained in:
Peter Krempa 2014-03-25 08:17:27 +01:00
parent a52feff02d
commit 562112f4f9
1 changed files with 3 additions and 4 deletions

View File

@ -33,14 +33,14 @@ int
virISCSIConnectionLogin(const char *portal, virISCSIConnectionLogin(const char *portal,
const char *initiatoriqn, const char *initiatoriqn,
const char *target) const char *target)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_RETURN_CHECK;
int int
virISCSIConnectionLogout(const char *portal, virISCSIConnectionLogout(const char *portal,
const char *initiatoriqn, const char *initiatoriqn,
const char *target) const char *target)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_RETURN_CHECK; ATTRIBUTE_RETURN_CHECK;
int int
@ -52,8 +52,7 @@ virISCSIScanTargets(const char *portal,
const char *initiatoriqn, const char *initiatoriqn,
size_t *ntargetsret, size_t *ntargetsret,
char ***targetsret) char ***targetsret)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
int int
virISCSINodeUpdate(const char *portal, virISCSINodeUpdate(const char *portal,