network: Fix upgrade from libvirt older than 1.2.4
network: Fix upgrade from libvirt older than 1.2.4

Starting from libvirt-1.2.4, network state XML files moved to another
directory (see commit b9e95491) and libvirt automatically migrates the
network state files to a new location. However, the code used
dirent.d_type which is not supported by all filesystems. Thus, when
libvirt was upgraded on a host which used such filesystem, network state
XMLs were not properly moved and running networks disappeared from
libvirt.

This patch falls back to lstat() whenever dirent.d_type is DT_UNKNOWN to
fix this issue.

https://bugzilla.redhat.com/show_bug.cgi?id=1167145
Signed-off-by: Jiri Denemark <62bdf77dc47919a4d59a91822129d14633cfca81@redhat.com>

rlaager/libvirt,rlaager/libvirt,nertpinx/libvirt,VenkatDatta/libvirt,VenkatDatta/libvirt,shugaoye/libvirt,agx/libvirt,nertpinx/libvirt,rlaager/libvirt,datto/libvirt,jfehlig/libvirt,jfehlig/libvirt,agx/libvirt,elmarco/libvirt,fabianfreyer/libvirt,datto/libvirt,taget/libvirt,zippy2/libvirt,jardasgit/libvirt,crobinso/libvirt,jardasgit/libvirt,eskultety/libvirt,olafhering/libvirt,VenkatDatta/libvirt,nertpinx/libvirt,jfehlig/libvirt,zippy2/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,taget/libvirt,elmarco/libvirt,nertpinx/libvirt,zippy2/libvirt,nertpinx/libvirt,libvirt/libvirt,olafhering/libvirt,crobinso/libvirt,olafhering/libvirt,shugaoye/libvirt,elmarco/libvirt,datto/libvirt,shugaoye/libvirt,agx/libvirt,andreabolognani/libvirt,libvirt/libvirt,shugaoye/libvirt,libvirt/libvirt,VenkatDatta/libvirt,shugaoye/libvirt,taget/libvirt,jardasgit/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,agx/libvirt,eskultety/libvirt,VenkatDatta/libvirt,crobinso/libvirt,datto/libvirt,taget/libvirt,jardasgit/libvirt,agx/libvirt,rlaager/libvirt,crobinso/libvirt,zippy2/libvirt,andreabolognani/libvirt,libvirt/libvirt,datto/libvirt,elmarco/libvirt,eskultety/libvirt,taget/libvirt,andreabolognani/libvirt,rlaager/libvirt,eskultety/libvirt,jfehlig/libvirt,olafhering/libvirt,eskultety/libvirt,jardasgit/libvirt,elmarco/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt