[libvirt] [PATCH] Properly advertise cpuselection guest capability

Daniel Veillard veillard at redhat.com
Wed Apr 7 08:37:41 UTC 2010


On Tue, Apr 06, 2010 at 05:54:58PM +0200, Jiri Denemark wrote:
> There's no sense in advertising cpuselection capability when host CPU
> is not properly detected and advertised in host capabilities.
> ---
>  src/qemu/qemu_conf.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
> index 3fb0074..ff5bd43 100644
> --- a/src/qemu/qemu_conf.c
> +++ b/src/qemu/qemu_conf.c
> @@ -892,7 +892,8 @@ qemudCapsInitGuest(virCapsPtr caps,
>  
>      guest->arch.defaultInfo.emulator_mtime = binary_mtime;
>  
> -    if (qemudProbeCPUModels(binary, info->arch, &ncpus, NULL) == 0
> +    if (caps->host.cpu
> +        && qemudProbeCPUModels(binary, info->arch, &ncpus, NULL) == 0
>          && ncpus > 0
>          && !virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0))
>          goto error;

  We usually put && on end of line, and I really prefer fully parenthesized
tests expressions, so I would go for a bit of cleanup too.

ACK

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list