• C
    Compressed save image format for Qemu. · 2d6a5819
    Chris Lalancette 提交于
    Implement a compressed save image format for qemu.  While ideally
    we would have the choice between compressed/non-compressed
    available to the libvirt API, unfortunately there is no "flags"
    parameter to the virDomainSave() API.  Therefore, implement this
    as a qemu.conf option.  gzip, bzip2, and lzma are implemented, and
    it should be very easy to implement additional compression
    methods.
    
    One open question is if/how we should detect the compression
    binaries.  One way to do it is to do compile-time setting of the
    paths (via configure.in), but that doesn't seem like a great thing
    to do.  My preferred solution is not to detect at all;
    when we go to run the commands that need them, if they
    aren't available, or aren't available in one of the standard paths,
    then we'll fail.  That's also the solution implemented in this patch.
    
    In the future, we'll have a more robust (managed) save/restore API,
    at which time we can expose this functionality properly in the API.
    
    V2: get rid of redundant dd command and just use >> to append data.
    V3: Add back the missing pieces for the enum and bumping the save version.
    V4: Make the compressed field in the save_header an int.
        Implement LZMA compression.
    Signed-off-by: NChris Lalancette <clalance@redhat.com>
    2d6a5819
qemu_driver.c 222.3 KB