提交 58a54dc3 编写于 作者: P Peter Krempa

qemu: Stop recursive detection of image chains when an image is missing

Commit e0c469e5 that fixes the detection
of image chain wasn't complete. Iteration through the backing image
chain has to stop at the last existing image if some of the images are
missing otherwise the backing chain that is cached contains entries with
paths being set to NULL resulting to:

error: Unable to allow access for disk path (null): Bad address

Fortunately stat() is kind enough not to crash when it's presented with
a NULL argument. At least on Linux.
上级 03cd6e4a
......@@ -728,8 +728,13 @@ virStorageFileGetMetadataFromBuf(int format,
meta->backingStore = absolutePathFromBaseFile(path, backing);
if (meta->backingStore == NULL) {
/* the backing file is (currently) unavailable, treat this
* file as standalone */
* file as standalone:
* backingStoreRaw is kept to mark broken image chains */
meta->backingStoreIsFile = false;
backingFormat = VIR_STORAGE_FILE_NONE;
VIR_WARN("Backing file '%s' of image '%s' is missing.",
meta->backingStoreRaw, path);
}
}
VIR_FREE(backing);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册