]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: refactor metadata lookup
authorEric Blake <eblake@redhat.com>
Wed, 6 Feb 2013 23:33:45 +0000 (16:33 -0700)
committerEric Blake <eblake@redhat.com>
Fri, 15 Feb 2013 23:07:00 +0000 (16:07 -0700)
commit2485f921536659181c9afa30d4fc1ee99dc064ae
treeb84eedb593132dd070c09c701c88f744d525ff9b
parentb7df4f92d6a62f4ec7513af11590f77152e0a19b
storage: refactor metadata lookup

Prior to this patch, we had the callchains:
external users
  \-> virStorageFileGetMetadataFromFD
      \-> virStorageFileGetMetadataFromBuf
virStorageFileGetMetadataRecurse
  \-> virStorageFileGetMetadataFromFD
      \-> virStorageFileGetMetadataFromBuf

However, a future patch wants to add an additional parameter to
the bottom of the chain, for use by virStorageFileGetMetadataRecurse,
without affecting existing external callers.  Since there is only a
single caller of the internal function, we can repurpose it to fit
our needs, with this patch giving us:

external users
  \-> virStorageFileGetMetadataFromFD
      \-> virStorageFileGetMetadataInternal
virStorageFileGetMetadataRecurse /
  \-> virStorageFileGetMetadataInternal

* src/util/virstoragefile.c (virStorageFileGetMetadataFromFD):
Move most of the guts...
(virStorageFileGetMetadataFromBuf): ...here, and rename...
(virStorageFileGetMetadataInternal): ...to this.
(virStorageFileGetMetadataRecurse): Use internal helper.
src/util/virstoragefile.c