On 04/11/2014 01:18 PM, John Ferlan wrote:
On 04/11/2014 12:21 AM, Eric Blake wrote:
> The original chain lookup code had to pass in the starting name,
> because it was not available in the chain. But now that we have
> added fields to the struct, this parameter is redundant.
>
> * src/util/virstoragefile.h (virStorageFileChainLookup): Alter
> signature.
> * src/util/virstoragefile.c (virStorageFileChainLookup): Adjust
> handling of top of chain.
> * src/qemu/qemu_driver.c (qemuDomainBlockCommit): Adjust caller.
> * tests/virstoragetest.c (testStorageLookup, mymain): Likewise.
>
>
> const char *virStorageFileChainLookup(virStorageFileMetadataPtr chain,
> - const char *start,
> const char *name,
> virStorageFileMetadataPtr *meta,
> const char **parent)
Expanded out a bit more shows:
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
not being changed - so on input previous chain and start could not be
NULL - now 'name' would be NONNULL which covers a previous concern, but
probably isn't correct...
Indeed, name can be NULL, per the documentation comment, and I just
overlooked the attributes when removing a parameter.
ACK - just remove the NONNULL(2) it seems.
Fixed with this and pushed.
diff --git i/src/util/virstoragefile.h w/src/util/virstoragefile.h
index caf1d2f..959937c 100644
--- i/src/util/virstoragefile.h
+++ w/src/util/virstoragefile.h
@@ -306,7 +306,7 @@ const char
*virStorageFileChainLookup(virStorageFileMetadataPtr chain,
const char *name,
virStorageFileMetadataPtr *meta,
const char **parent)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ ATTRIBUTE_NONNULL(1);
void virStorageFileFreeMetadata(virStorageFileMetadataPtr meta);
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org