提交 61e45dfb 编写于 作者: P Peter Krempa

util: storage: Fix build after 25924dec

The commit referenced above changed function arguments of
virStorageFileGetMetadataFromBuf() but didn't tweak the
ATTRIBUTE_NONNULL tied to them. This was caught by coverity as it
actually obeys them. We disabled them for GCC and thus it didn't show
up.

Additionally in commit 3ea661de I passed
NULL to the backingFormat argument which was also marked as nonnull. Use
a dummy int's address when the argument isn't supplied so that the code
doesn't need to change much.
上级 37381666
......@@ -955,6 +955,10 @@ virStorageFileGetMetadataFromBuf(const char *path,
int *backingFormat)
{
virStorageSourcePtr ret = NULL;
int dummy;
if (!backingFormat)
backingFormat = &dummy;
if (!(ret = virStorageFileMetadataNew(path, format)))
return NULL;
......
......@@ -301,8 +301,7 @@ virStorageSourcePtr virStorageFileGetMetadataFromBuf(const char *path,
size_t len,
int format,
int *backingFormat)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4)
ATTRIBUTE_NONNULL(5);
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int virStorageFileChainGetBroken(virStorageSourcePtr chain,
char **broken_file);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册