On Mon, Nov 21, 2016 at 12:21:04AM +0100, Jiri Denemark wrote:
> If a user asked for a KVM domain capabilities when KVM is not available,
> we would happily return data we got when probing through TCG and
> pretended they were relevant for KVM. Let's just report KVM is not
> supported to avoid confusion.
> 
> Signed-off-by: Jiri Denemark <[email protected]>
> ---
>  src/qemu/qemu_driver.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 925631b..09a8d06 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -18811,6 +18811,13 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn,
>      if (virttype == VIR_DOMAIN_VIRT_NONE)
>          virttype = capsType;
>  
> +    if (virttype == VIR_DOMAIN_VIRT_KVM && capsType == VIR_DOMAIN_VIRT_QEMU) 
> {
> +        virReportError(VIR_ERR_INVALID_ARG,
> +                       _("KVM is not supported by '%s' on this host"),
> +                       emulatorbin);
> +        goto cleanup;
> +    }

So this uses the *capsType* from the previous patch.

ACK to this and previous patch, but for the sake of patch isolation the
*capsType* should be introduced by this patch.  I'll leave it up to you to
decide if you want to make the patches looks better or not :).

Pavel

> +
>      if (!(domCaps = virDomainCapsNew(emulatorbin, machine, arch, virttype)))
>          goto cleanup;
>  
> -- 
> 2.10.2
> 
> --
> libvir-list mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to