On Wed, Sep 26, 2012 at 9:55 AM, Prasanna Santhanam
<prasanna.santha...@citrix.com> wrote:
> On Wed, Sep 26, 2012 at 08:23:31AM -0400, Sowmya Krishnan wrote:
>> Here's the output on Ubuntu:
>> qemu-img --help|grep convert |grep snapshot
>>   convert [-c] [-p] [-f fmt] [-t cache] [-O output_fmt] [-o options] [-s 
>> snapshot_name] [-S sparse_size] filename [filename2 [...]] output_filename
>>
>> which is similar to RHEL6.2:
>> qemu-img --help|grep convert |grep snapshot
>>   convert [-c] [-p] [-f fmt] [-t cache] [-O output_fmt] [-o options] [-s 
>> snapshot_name] [-S sparse_size] filename [filename2 [...]] output_filename
>>
>> Returns null on RHEL6.3:
>> [root@rhel63 ~]# qemu-img --help|grep convert |grep snapshot
>> [root@rhel63 ~]#
>
>
> Thanks, Could you post a bug?
>
> The issue seems to be in
>  
> plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
>
> 4289     private boolean isSnapshotSupported() {
> 4290         String result = executeBashScript("qemu-img --help|grep -E 
> convert|snapshot");
> 4291         if (result != null) {
> 4292             return false;
> 4293         } else {
> 4294             return true;
> 4295         }
> 4296     }
>
> The help text differs between ubuntu and rhel:
> http://manpages.ubuntu.com/manpages/natty/man1/qemu-img.1.html
>
> https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/sect-Virtualization-Tips_and_tricks-Using_qemu_img.html
>
> Should we depend on that?
>

We've set the requirements as EL6.3 or Ubuntu 12.04, or another distro
with a similarly recent version of qemu/libvirt/KVM - and parsing the
help output of a command run in a shell seems inelegant. Why not
default to assuming that it works and if it pukes to cleanly say it
isn't supported?

--David

Reply via email to