• Pavel Emelyanov's avatar
    img: Don't create empty images · 8ce37e67
    Pavel Emelyanov authored
    Currently on dump we generate too many image files, effectively
    all the stuff from the GLOB set is created. The thing is that
    sometimes some of created images can be empty (just contain the
    magic number at the head). Thos images are useless and just
    waste the space.
    
    When applied after the "empty images" set, this introduces the
    lazy images -- when we call open_image() the actual file is
    only created (and the magic number is written into it) when the
    very first object goes into it.
    
    For example for the simplest test we have, then static/env00
    one, the created image files are
    
       core-7290.img
       creds-7290.img
       fdinfo-2.img
       fs-7290.img
       ids-7290.img
       inventory.img
       mm-7290.img
       pagemap-7290.img
       pages-1.img
       pstree.img
       reg-files.img
       sigacts-7290.img
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    8ce37e67
protobuf.c 13.2 KB