On 08/13/2010 08:53 AM, Chris Lalancette wrote:
Signed-off-by: Chris Lalancette <clalance(a)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(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org