On 04/10/2014 03:58 AM, Peter Krempa wrote:
On 04/10/14 05:41, Eric Blake wrote:
> So far, my work has been merely preserving the status quo of
> backing file analysis. But this patch starts to tread in the
> territory of making the backing chain code more powerful - we
> will eventually support network storage containing non-raw
> formats. Here, we expose metadata information about a network
> backing store, even if that information is still hardcoded to
> a raw format for now.
> + } else {
> + if (VIR_STRDUP(meta->backingStoreRaw, backing) < 0) {
> + VIR_FREE(backing);
> + goto cleanup;
> + }
> + backingFormat = VIR_STORAGE_FILE_RAW;
> }
> VIR_FREE(backing);
> meta->backingStoreFormat = backingFormat;
This hunk invalidates the comment in virStorageFileChainCheckBroken, as
currently backing store raw will be set always.
ACK with the comment updated.
I squashed this in and pushed, along with the other ACKed patches in the
series:
diff --git i/src/util/virstoragefile.c w/src/util/virstoragefile.c
index 7a91a01..8222528 100644
--- i/src/util/virstoragefile.c
+++ w/src/util/virstoragefile.c
@@ -1272,7 +1272,8 @@ virStorageFileGetMetadata(const char *path, int
format,
*
* If CHAIN is broken, set *brokenFile to the broken file name,
* otherwise set it to NULL. Caller MUST free *brokenFile after use.
- * Return 0 on success, negative on error.
+ * Return 0 on success (including when brokenFile is set), negative on
+ * error (allocation failure).
*/
int
virStorageFileChainGetBroken(virStorageFileMetadataPtr chain,
@@ -1288,8 +1289,8 @@
virStorageFileChainGetBroken(virStorageFileMetadataPtr chain,
tmp = chain;
while (tmp) {
- /* Break if no backing store, backing store is not file, or
- * other problem such as infinite loop */
+ /* Break when we hit end of chain; report error if we detected
+ * a missing backing file, infinite loop, or other error */
if (!tmp->backingStoreRaw)
break;
if (!tmp->backingStore) {
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org