[libvirt] [PATCH 2/4] PowerPC : Forbid NULL CPU model with 'host-model' mode.

Ján Tomko jtomko at redhat.com
Tue Feb 17 12:46:32 UTC 2015


On Sun, Feb 15, 2015 at 09:54:15AM +0530, Prerna Saxena wrote:
> 
> PowerPC : Forbid NULL CPU model with 'host-model' mode in qemu command line.
> 
> This ensures that an XML such as following:
> ...
>   <cpu mode='host-model'>
>     <model fallback='allow'/>
>   </cpu>
> ...
> 
> will not generate a '-cpu host,compat=(null)' command line with qemu-system-ppc64.
> 
> Signed-off-by: Prerna Saxena <prerna at linux.vnet.ibm.com>
> ---
>  src/qemu/qemu_command.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

ACK

> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 9c25788..317bb19 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -6685,7 +6685,8 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
>          virBufferAddLit(buf, "host");
>  
>          if (ARCH_IS_PPC64(def->os.arch) &&
> -            cpu->mode == VIR_CPU_MODE_HOST_MODEL) {
> +            cpu->mode == VIR_CPU_MODE_HOST_MODEL &&
> +            def->cpu->model != NULL) {
>              virBufferAsprintf(buf, ",compat=%s", def->cpu->model);

So we skip over setting featCpu when using compat=.

Is it possible to specify custom features together with compat=?
If so, it seems commit adff345 (released in v1.2.12) broke this.

Jan

>          } else {
>              featCpu = cpu;
> -- 
> 1.9.3
> 
> -- 
> Prerna Saxena
> 
> Linux Technology Centre,
> IBM Systems and Technology Lab,
> Bangalore, India
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150217/8dd32447/attachment-0001.sig>


More information about the libvir-list mailing list