Re: [PATCH 16/41] qemu: Fill in CPU domain capabilities

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

 




On 08/12/2016 09:33 AM, Jiri Denemark wrote:
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---
>  src/qemu/qemu_capabilities.c                       |  24 +-
>  src/qemu/qemu_capabilities.h                       |   3 +-
>  src/qemu/qemu_driver.c                             |   7 +-
>  tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml   |  31 +-
>  .../qemu_2.6.0-gicv2-virt.aarch64.xml              |  37 +-
>  .../qemu_2.6.0-gicv3-virt.aarch64.xml              |  37 +-
>  tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml  |  37 +-
>  tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml  | 437 ++++++++++++++++++++-
>  tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml   |  35 +-
>  tests/domaincapstest.c                             |  56 ++-
>  10 files changed, 682 insertions(+), 22 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index aeea3a3..7a7ddb8 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -4194,6 +4194,26 @@ virQEMUCapsFillDomainOSCaps(virDomainCapsOSPtr os,
>  
>  
>  static int
> +virQEMUCapsFillDomainCPUCaps(virCapsPtr caps,
> +                             virQEMUCapsPtr qemuCaps,
> +                             virDomainCapsPtr domCaps)
> +{
> +
> +    if (domCaps->virttype == VIR_DOMAIN_VIRT_KVM &&
> +        virQEMUCapsGuestIsNative(caps->host.arch, qemuCaps->arch))

                                    ^^^^
Can caps be NULL?

> +        domCaps->cpu.hostPassthrough = true;
> +
> +    if (qemuCaps->cpuDefinitions && caps && caps->host.cpu)

                                       ^^^^
Since you check here


So far as this patch it doesn't seem so and if I check at the end the
two callers to virQEMUCapsFillDomainCaps have failure paths for !caps
prior to the calls.

Perhaps adding a NONNULL to the prototype will just help clear things up.




> +        domCaps->cpu.hostModel = virQEMUCapsGuestIsNative(caps->host.arch,
> +                                                          qemuCaps->arch);
> +
> +    domCaps->cpu.custom = virObjectRef(qemuCaps->cpuDefinitions);
> +
> +    return 0;
> +}
> +
> +

[...]

--
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]