提交 cc92ee32 编写于 作者: P Peter Krempa

util: virstoragefile: Don't mangle data stored about directories

Don't remove detected metadata about directory based storage volumes.
上级 44551275
......@@ -1043,11 +1043,8 @@ virStorageFileGetMetadataFromFDInternal(virStorageSourcePtr meta,
}
if (S_ISDIR(sb.st_mode)) {
/* No header to probe for directories, but also no backing
* file; therefore, no inclusion loop is possible, and we
* don't need canonName or relDir. */
VIR_FREE(meta->relDir);
VIR_FREE(meta->path);
/* No header to probe for directories, but also no backing file. Just
* update the metadata.*/
meta->type = VIR_STORAGE_TYPE_DIR;
meta->format = VIR_STORAGE_FILE_DIR;
ret = 0;
......
......@@ -709,6 +709,9 @@ mymain(void)
testFileData dir = {
.pathRel = "dir",
.pathAbs = absdir,
.path = canondir,
.relDirRel = ".",
.relDirAbs = datadir,
.type = VIR_STORAGE_TYPE_DIR,
.format = VIR_STORAGE_FILE_DIR,
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册