mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
util: virstoragefile: Don't mangle data stored about directories
Don't remove detected metadata about directory based storage volumes.
This commit is contained in:
parent
44551275a9
commit
cc92ee32cd
@ -1043,11 +1043,8 @@ virStorageFileGetMetadataFromFDInternal(virStorageSourcePtr meta,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (S_ISDIR(sb.st_mode)) {
|
if (S_ISDIR(sb.st_mode)) {
|
||||||
/* No header to probe for directories, but also no backing
|
/* No header to probe for directories, but also no backing file. Just
|
||||||
* file; therefore, no inclusion loop is possible, and we
|
* update the metadata.*/
|
||||||
* don't need canonName or relDir. */
|
|
||||||
VIR_FREE(meta->relDir);
|
|
||||||
VIR_FREE(meta->path);
|
|
||||||
meta->type = VIR_STORAGE_TYPE_DIR;
|
meta->type = VIR_STORAGE_TYPE_DIR;
|
||||||
meta->format = VIR_STORAGE_FILE_DIR;
|
meta->format = VIR_STORAGE_FILE_DIR;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -709,6 +709,9 @@ mymain(void)
|
|||||||
testFileData dir = {
|
testFileData dir = {
|
||||||
.pathRel = "dir",
|
.pathRel = "dir",
|
||||||
.pathAbs = absdir,
|
.pathAbs = absdir,
|
||||||
|
.path = canondir,
|
||||||
|
.relDirRel = ".",
|
||||||
|
.relDirAbs = datadir,
|
||||||
.type = VIR_STORAGE_TYPE_DIR,
|
.type = VIR_STORAGE_TYPE_DIR,
|
||||||
.format = VIR_STORAGE_FILE_DIR,
|
.format = VIR_STORAGE_FILE_DIR,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user