storage: Traverse backing chains of network disks

Now we don't need to skip backing chain detection for remote disks.
This commit is contained in:
Peter Krempa 2014-04-28 15:09:32 +02:00
parent b225444e25
commit 1423ae296f
2 changed files with 9 additions and 17 deletions

View File

@ -2428,12 +2428,10 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
int ret = 0;
uid_t uid;
gid_t gid;
const char *src = virDomainDiskGetSource(disk);
int type = virDomainDiskGetType(disk);
int type = virStorageSourceGetActualType(&disk->src);
if (!src ||
type == VIR_STORAGE_TYPE_NETWORK ||
type == VIR_STORAGE_TYPE_VOLUME)
if (type != VIR_STORAGE_TYPE_NETWORK &&
!disk->src.path)
goto cleanup;
if (disk->src.backingStore) {

View File

@ -3189,19 +3189,13 @@ virStorageFileGetMetadata(virStorageSourcePtr src,
if (!(cycle = virHashCreate(5, NULL)))
return -1;
if (virStorageSourceGetActualType(src) != VIR_STORAGE_TYPE_NETWORK) {
if (!src->relPath &&
VIR_STRDUP(src->relPath, src->path) < 0)
goto cleanup;
if (!src->relPath &&
VIR_STRDUP(src->relPath, src->path) < 0)
goto cleanup;
if (!src->relDir &&
!(src->relDir = mdir_name(src->path))) {
virReportOOMError();
goto cleanup;
}
} else {
/* TODO: currently unimplemented for non-local storage */
ret = 0;
if (!src->relDir &&
!(src->relDir = mdir_name(src->path))) {
virReportOOMError();
goto cleanup;
}