]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Change return type of virQEMUCapsFetchCPUDefinitions
authorJiri Denemark <jdenemar@redhat.com>
Thu, 10 Oct 2019 14:44:40 +0000 (16:44 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 20 Nov 2019 16:22:05 +0000 (17:22 +0100)
commita94f67ee697d9a13d00ae14c7ba56d15bf33d84b
tree204429d0a5cbdbb5c9d6e9567088583d9aaba36a
parentfb35cbb3293ae58c8d8bfd5f14ce6077001c393f
qemu: Change return type of virQEMUCapsFetchCPUDefinitions

The function would return a valid virDomainCapsCPUModelsPtr with empty
CPU models list if query-cpu-definitions exists in QEMU, but returns
GenericError meaning it's not in fact implemented. This behaviour is a
bit strange especially after such virDomainCapsCPUModels structure is
stored in capabilities XML and parsed back, which will result in NULL
virDomainCapsCPUModelsPtr rather than a structure containing nothing.

Let's just keep virDomainCapsCPUModelsPtr NULL if the QMP command is not
implemented and change the return value to int so that callers can
easily check for failure or success.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
src/qemu/qemu_process.c