• E
    storage: avoid short reads while chasing backing chain · 8eac3636
    Eric Blake 提交于
    Our backing file chain code was not very robust to an ill-timed
    EINTR, which could lead to a short read causing us to randomly
    treat metadata differently than usual.  But the existing
    virFileReadLimFD forces an error if we don't read the entire
    file, even though we only care about the header of the file.
    So add a new virFile function that does what we want.
    
    * src/util/virfile.h (virFileReadHeaderFD): New prototype.
    * src/util/virfile.c (virFileReadHeaderFD): New function.
    * src/libvirt_private.syms (virfile.h): Export it.
    * src/util/virstoragefile.c (virStorageFileGetMetadataInternal)
    (virStorageFileProbeFormatFromFD): Use it.
    Signed-off-by: NEric Blake <eblake@redhat.com>
    (cherry picked from commit 5327fad4)
    
    Conflicts:
    	src/util/virstoragefile.c: buffer signedness
    8eac3636
virfile.c 63.2 KB