On 7/14/23 16:38, Boris Fiuczynski wrote:
> Commit be1b7d5b18 introduced parsing /proc/cpuinfo for "address size"
> which is not including on S390 and therefore reports an internal error.
> Lets remove the parsing on S390.
> 
> Signed-off-by: Boris Fiuczynski <fiu...@linux.ibm.com>
> Reviewed-by: Marc Hartmayer <mhart...@linux.ibm.com>
> Reviewed-by: Collin Walling <wall...@linux.ibm.com>
> ---
>  src/cpu/cpu_x86.c                         |  2 +-
>  src/qemu/qemu_capabilities.c              |  2 +-
>  src/util/virhostcpu.c                     | 11 +++++++++--
>  src/util/virhostcpu.h                     |  3 ++-
>  tests/domaincapsdata/qemu_4.2.0.s390x.xml |  1 -
>  tests/domaincapsdata/qemu_5.2.0.s390x.xml |  1 -
>  tests/domaincapsdata/qemu_6.0.0.s390x.xml |  1 -
>  tests/domaincapsdata/qemu_8.1.0.s390x.xml |  1 -
>  tests/domaincapsmock.c                    |  7 +++++--
>  9 files changed, 18 insertions(+), 11 deletions(-)
> 
> diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
> index 8d371d5501..3c0163c4d1 100644
> --- a/src/cpu/cpu_x86.c
> +++ b/src/cpu/cpu_x86.c
> @@ -2795,7 +2795,7 @@ virCPUx86GetHost(virCPUDef *cpu,
>          VIR_DEBUG("Host CPU does not support invariant TSC");
>      }
>  
> -    if (virHostCPUGetPhysAddrSize(&addrsz) == 0) {
> +    if (virHostCPUGetPhysAddrSize(cpuData->arch, &addrsz) == 0) {
>          virCPUMaxPhysAddrDef *addr = g_new0(virCPUMaxPhysAddrDef, 1);
>  
>          addr->bits = addrsz;
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index c9f4b17208..d82fe88057 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -3911,7 +3911,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps,
>      }
>  
>      if (virQEMUCapsTypeIsAccelerated(type))
> -        virHostCPUGetPhysAddrSize(&physAddrSize);
> +        virHostCPUGetPhysAddrSize(hostArch, &physAddrSize);
>  
>      virQEMUCapsSetHostModel(qemuCaps, type, physAddrSize, cpu, migCPU, 
> fullCPU);
>  
> diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
> index 19195a1470..41be4bffe0 100644
> --- a/src/util/virhostcpu.c
> +++ b/src/util/virhostcpu.c
> @@ -1646,10 +1646,16 @@ virHostCPUGetSignature(char **signature)
>  }
>  
>  int
> -virHostCPUGetPhysAddrSize(unsigned int *size)
> +virHostCPUGetPhysAddrSize(const virArch hostArch, unsigned int *size)
>  {

Nit pick. Here ^^^ ...

> diff --git a/tests/domaincapsmock.c b/tests/domaincapsmock.c
> index cecb333602..6a23f2cb11 100644
> --- a/tests/domaincapsmock.c
> +++ b/tests/domaincapsmock.c
> @@ -37,9 +37,12 @@ virHostCPUGetMicrocodeVersion(virArch hostArch 
> G_GNUC_UNUSED)
>  }
>  
>  int
> -virHostCPUGetPhysAddrSize(unsigned int *size)
> +virHostCPUGetPhysAddrSize(const virArch hostArch, unsigned int *size)
>  {

.. and here ^^^ arguments should be on separate lines. It allows for
smaller diffs should we ever introduce another argument.

Reviewed-by: Michal Privoznik <mpriv...@redhat.com>

and pushed. Thanks for catching this.

Michal

Reply via email to