12926a7 qemuConnectGetDomainCapabilities: Use wiser defaults

Authored and Committed by mprivozn 9 years ago
    qemuConnectGetDomainCapabilities: Use wiser defaults
    
    Up to now, users have to pass two arguments at least: domain virt type
    ('qemu' vs 'kvm') and one of emulatorbin or architecture. This is not
    much user friendly. Nowadays users mostly use KVM and share the host
    architecture with the guest. So now, the API (and subsequently virsh
    command) can be called with all NULLs  (without any arguments).
    
    Before this patch:
     # virsh domcapabilities
     error: failed to get emulator capabilities
     error: virttype_str in qemuConnectGetDomainCapabilities must not be NULL
    
     # virsh domcapabilities kvm
     error: failed to get emulator capabilities
     error: invalid argument: at least one of emulatorbin or architecture fields must be present
    
    After:
    
     # virsh domcapabilities
     <domainCapabilities>
       <path>/usr/bin/qemu-system-x86_64</path>
       <domain>kvm</domain>
       <machine>pc-i440fx-2.1</machine>
       <arch>x86_64</arch>
       <vcpu max='255'/>
     </domainCapabilities>
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    
        
file modified
+10 -17