deb8c66 util: split the virNumaGetHugePageInfoPath into separate function

1 file Authored by Luyao Huang 8 years ago, Committed by John Ferlan 8 years ago,
    util: split the virNumaGetHugePageInfoPath into separate function
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1265114
    
    Refactor helper virNumaGetHugePageInfoPath to handle returning a directory
    path when passed a page_size of 0 and suffix == NULL into a new helper
    virNumaGetHugePageInfoDir which will only be called when a directory
    path is expected to be returned. This solves the issue where the helper
    was called with page_size == 0 expecting a file path in return, but
    instead got a directory path and failed in virFileReadAll with:
    
        error : virFileReadAll:1358 : Failed to read file
                    '/sys/devices/system/node/node0/hugepages/': Is a directory
    
    Since virNumaGetPages API expects to return a directory by passing
    page_size == 0 and suffix == NULL, it will now call the new helper.
    Callers to virNumaGetHugePageInfoPath expect to return a file path
    which could then be used in the call to virFileReadAll.
    
    Signed-off-by: Luyao Huang <lhuang@redhat.com>
    
        
file modified
+19 -32