[PATCH v2 02/10] hyperv: fix nodeGetInfo failures caused by long CPU names

Neal Gompa ngompa13 at gmail.com
Tue Oct 6 00:54:53 UTC 2020


On Mon, Oct 5, 2020 at 12:21 PM Matt Coleman <mcoleman at datto.com> wrote:
>
> Some CPU model names were too long for _virNodeInfo.model.
> For example: Intel Xeon CPU E5-2620 v2 @ 2.10GHz
> This commit removes the clock frequency suffix.
>
> Signed-off-by: Matt Coleman <matt at datto.com>
> ---
>  src/hyperv/hyperv_driver.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
> index b57325f2a5..9bbc2f67fb 100644
> --- a/src/hyperv/hyperv_driver.c
> +++ b/src/hyperv/hyperv_driver.c
> @@ -285,6 +285,10 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
>          } else if (STRPREFIX(tmp, "(TM)")) {
>              memmove(tmp, tmp + 4, strlen(tmp + 4) + 1);
>              continue;
> +        } else if (STRPREFIX(tmp, " @ ")) {
> +            /* Remove " @ X.YZGHz" from the end. */
> +            *tmp = '\0';
> +            break;
>          }
>
>          ++tmp;
> --
> 2.27.0
>
>

Reviewed-by: Neal Gompa <ngompa13 at gmail.com>

-- 
真実はいつも一つ!/ Always, there's only one truth!





More information about the libvir-list mailing list