virDomainDiskDefForeachPath: Prefer virStorageSourceIsLocalStorage

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2017-03-30 17:02:39 +02:00
parent 3054dacf9a
commit c3a83bad2a

View File

@ -25342,10 +25342,8 @@ virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
}
for (tmp = disk->src; tmp; tmp = tmp->backingStore) {
int actualType = virStorageSourceGetActualType(tmp);
/* execute the callback only for local storage */
if (actualType != VIR_STORAGE_TYPE_NETWORK &&
actualType != VIR_STORAGE_TYPE_VOLUME &&
if (virStorageSourceIsLocalStorage(tmp) &&
tmp->path) {
if (iter(disk, tmp->path, depth, opaque) < 0)
goto cleanup;