[libvirt] [PATCH 3/3] Plumb managedsave compression through to virsh.

Eric Blake eblake at redhat.com
Mon Aug 16 16:24:48 UTC 2010


On 08/13/2010 08:53 AM, Chris Lalancette wrote:
> Signed-off-by: Chris Lalancette <clalance at redhat.com>
> ---
>  tools/virsh.c |   22 +++++++++++++++++++++-
>  1 files changed, 21 insertions(+), 1 deletions(-)

Depending on how the discussion on 2/3 goes:

>  
> +    compress = vshCommandOptString(cmd, "compression", NULL);
> +    if (compress) {
> +        if (STREQ(compress, "gzip"))
> +            flags |= VIR_DOMAIN_SAVE_COMPRESS_GZIP;
> +        else if (STREQ(compress, "bzip2"))
> +            flags |= VIR_DOMAIN_SAVE_COMPRESS_BZIP2;
> +        else if (STREQ(compress, "xz"))
> +            flags |= VIR_DOMAIN_SAVE_COMPRESS_XZ;
> +        else if (STREQ(compress, "lzop"))
> +            flags |= VIR_DOMAIN_SAVE_COMPRESS_LZOP;
> +        else {
> +            vshError(ctl, "%s",
> +                     _("Invalid compression type; it must be one of 'gzip', 'bzip2', 'xz', or 'lzop'"));
> +            return FALSE;

If we add a qemu.conf default compression setting, then virsh also needs
to support a '--compress none' to override the default.

Hmm, that also means that VIR_DOMAIN_SAVE_COMPRESS_RAW needs to be
distinct from 0 (that is, passing 0 means that you are requesting the
default, while requesting raw means that you are explicitly requesting
no compression even if the default would use compression).

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100816/87946931/attachment-0001.sig>


More information about the libvir-list mailing list