From: Matt Coleman Date: Mon, 5 Oct 2020 16:20:07 +0000 (-0400) Subject: hyperv: fix nodeGetInfo failures caused by long CPU names X-Git-Tag: v6.9.0-rc1~230 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a59362febc19b4f09fdb11e6590c2ef5195c93c;p=thirdparty%2Flibvirt.git hyperv: fix nodeGetInfo failures caused by long CPU names 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 Reviewed-by: Neal Gompa Reviewed-by: Michal Privoznik --- 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;