]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuConnectGetDomainCapabilities: Use wiser defaults
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 17 Jul 2014 09:06:09 +0000 (11:06 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 24 Jul 2014 07:19:09 +0000 (09:19 +0200)
commit12926a7c390539ad920cedec321cd3a502623f4f
tree51700d5146f18e40304e697e176dd0f54014a7d8
parentdc8b7ce7bcea9130609b4498a957545950f78af7
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>
src/qemu/qemu_driver.c