4f9e61f util: Produce friendlier error message to user

1 file Authored by Luyao Huang 8 years ago, Committed by John Ferlan 8 years ago,
    util: Produce friendlier error message to user
    
    Commit id '1c24cfe9' added error messages for virNumaSetPagePoolSize;
    however, virNumaGetHugePageInfo also uses virNumaGetHugePageInfoPath
    in order to build the path, but it never checked upon return if
    the built path exists which could lead to an error message as follows:
    
    $ virsh freepages 0 1
    error: Failed to open file
        '/sys/devices/system/node/node0/hugepages/hugepages-1kB/free_hugepages':
        No such file or directory
    
    Rather than add the same message for the other two callers, adjust
    the virNumaGetHugePageInfoPath in order not only build the path, but
    also check if the built path exists.  If the path does not exist,
    then generate the error message and return failure.
    
    Signed-off-by: Luyao Huang <lhuang@redhat.com>
    
        
file modified
+30 -26