Re: [PATCH] qemu: allow QMP probing of CPU definitions to fail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 16, 2017 at 09:41:42 +0100, Guido Günther wrote:
> This unbreaks emulators that don't support this command such as
> qemu-system-mips*.
> 
> Reference: http://bugs.debian.org/854125
> ---
>  src/qemu/qemu_capabilities.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 70f9ed777..207deedbb 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -2793,7 +2793,7 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps,
>      size_t i;
>  
>      if ((ncpus = qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0)
> -        return -1;
> +        return 0;
>  
>      if (!(models = virDomainCapsCPUModelsNew(ncpus)))
>          goto cleanup;

The fix is not correct because we don't want to ignore all errors.

There are two options how to fix this bug:

- you can add a new capability associated with the command and return
  from virQEMUCapsProbeQMPCPUDefinitions if this capability is not set,

- or just add qemuMonitorJSONHasError(reply, "CommandNotFound") in
  qemuMonitorJSONGetCPUDefinitions to the if statement which already
  checks for GenericError.

I think the capability is slightly better.

Jirka

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux