05e702c getstats: rearrange blockinfo gathering

Authored and Committed by ericb 9 years ago
    getstats: rearrange blockinfo gathering
    
    Ultimately, we want to avoid read()ing a file while qemu is running.
    We still have to open() block devices to determine their physical
    size, but that is safer.  This patch rearranges code to group
    together all code that reads the image, to make it easier for later
    patches to skip the metadata collection when possible.
    
    * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Check for empty
    disk up front.  Place metadata reading next to use.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    
        
file modified
+22 -27