partx: make dirent d_type usage more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
lib/sysfs: make dirent d_type usage more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
switch_root: make dirent d_type usage more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
lscpu: don't assume filesystem supports d_type when searching for NUMA nodes

Not all file systems support the d_type field and simply checking for
d_type == DT_DIR in is_node_dirent would cause the test suite to fail
if run on (for example) XFS.

The simple fix is to check for DT_DIR or DT_UNKNOWN in is_node_dirent.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
lscpu: read_hypervisor_dmi: only fallback to memory scan on x86/x86_64

As the comment in the code says, this method is really only valid
on x86 and x86_64, so add a #ifdef for those architectures around
that code block.

This was causing "Program lscpu tried to access /dev/mem between f0000->100000."
warnings on some ppc64 machines.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>