From nobody Fri Apr 26 20:19:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534071954603417.45816094689985; Sun, 12 Aug 2018 04:05:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BBBB43086273; Sun, 12 Aug 2018 11:05:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 856F52010CA0; Sun, 12 Aug 2018 11:05:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C50304BB78; Sun, 12 Aug 2018 11:05:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7CB5fUI008287 for ; Sun, 12 Aug 2018 07:05:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id BA2A61001947; Sun, 12 Aug 2018 11:05:41 +0000 (UTC) Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B22F510694C1 for ; Sun, 12 Aug 2018 11:05:39 +0000 (UTC) Received: from mail-qt0-f196.google.com (mail-qt0-f196.google.com [209.85.216.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05E2E30B9302 for ; Sun, 12 Aug 2018 11:05:39 +0000 (UTC) Received: by mail-qt0-f196.google.com with SMTP id w26-v6so14713939qto.5 for ; Sun, 12 Aug 2018 04:05:38 -0700 (PDT) Received: from bebop.8.8.8.8 ([2804:7f5:d180:515e:95fe:303a:50b3:8a67]) by smtp.gmail.com with ESMTPSA id r18-v6sm9553028qtc.38.2018.08.12.04.05.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Aug 2018 04:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=a+L5jpbIwQnUe/YhxMrMVZV8h7XNBjH4nI6DM+7lI8E=; b=WrHDLqHQnwx/yoqWpB6nBdUtgYrJv1GpN+97oHw5Ol2KGJqcifDVLDkSRdPVcSXat1 ymEpqIihBnaoQExpQZy/CQDPsxq0GIP7m9Hyk1lVgAuBPMXTPQt1/0jEAr08beZTaESA igkW70hbVnBgv1ju7WqxH2LIHMIY1k/vzm0RFr3jc+ww8YJR1PYgCJzGCj55fXUqiAMY QZtTsFlqmZCgCProMudng7uhjUAi3dp642yPa5Z/tln+ktecEgC86Geb+xbIeLIuYtIz 1EV90ZmFmWvf/e+KKAY2gBSh7M4cDBoW0sAr2uP+ed+Kx2MKcbHfWJdWqIimLj9lzabV OU/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=a+L5jpbIwQnUe/YhxMrMVZV8h7XNBjH4nI6DM+7lI8E=; b=QOEIdGHalM8uLFFHF0Xe7cDC1PARiqB6UY7qUKSV5LxlC2iV/I8urKWG0IaaaBn3fb tGOmjXEYaISqxsWSlaM4WXNRRPiT1KuRrj1DRKYlEhw9oSWZlDCH2zUs24ObZXAFU0D5 MK91a3+B8sE/jRsPyPsT5jUOgYdeJT/TYqV2xJUHTS4lXZc9L1kuHSPLgNDMZV0z8muo zo5mnjnsx4EA6ZEQG//+/TrZU0N4rzco4OHUSo6OIF+Xcdsx8Xf3pPuOWNz/cv5cJk5x KJBqY7hq9U8UnpWVGMyDdOB5llKM0WD1Rhsq6f6PT6bopvnjBjXxnzSNmf0Q3dnfQ9Pq np1g== X-Gm-Message-State: AOUpUlHjy9ozqAjKriJpQ7WXSdl2PFalCYKRUGGha1Zg6G5VQCIhZFGQ 3GElSEhvJQH17Nbzb2hITA8RDiPV X-Google-Smtp-Source: AA+uWPxf8FAfu+wZZYiEjcuvA1rkjbfrka7+hZOFEKhTXObgt9zHPFVUo7OepGvohMcjXZfkhDaaSg== X-Received: by 2002:aed:3d95:: with SMTP id i21-v6mr13146507qtf.232.1534071937752; Sun, 12 Aug 2018 04:05:37 -0700 (PDT) From: Marcos Paulo de Souza To: libvir-list@redhat.com Date: Sun, 12 Aug 2018 08:05:19 -0300 Message-Id: <20180812110519.12052-1-marcos.souza.org@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sun, 12 Aug 2018 11:05:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sun, 12 Aug 2018 11:05:39 +0000 (UTC) for IP:'209.85.216.196' DOMAIN:'mail-qt0-f196.google.com' HELO:'mail-qt0-f196.google.com' FROM:'marcos.souza.org@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.13 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.216.196 mail-qt0-f196.google.com 209.85.216.196 mail-qt0-f196.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Marcos Paulo de Souza Subject: [libvirt] [PATCH] esx: Fix nodeGetInfo so cpu model fits inside nodeinfo->model X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sun, 12 Aug 2018 11:05:51 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Commit 6c0d0210cbcd5d647f0d882c07f077d444bc707d changed the behavior of virStr*cpy* functions, so now the nodeGetInfo call fails. Version 4.1.0 (default for Fedora 28) works: Model: Intel Core i7-4500U CPU @ 1.80G Current master tries to write "Intel Core i7-4500U CPU @ 1.80GHz", but the string is bigger than nodeinfo->model (which is a char[32]). So this patch "cuts" the string, and presents the same output from 4.1.0. Signed-off-by: Marcos Paulo de Souza --- When testing both qemu and lxc drivers, both return "x86_64", as both call virCapabilitiesGetNodeInfo in order the get all info the "node", but they = are a Linux machine. When it comes to ESX, it returns a string from the ESX server, which is sa= me info that I can find in /proc/cpuinfo of my machine (but without the () pa= rts): model name : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz The question is: should libvirt increase the model size, or just find a be= tter way for ESX to present this info? src/esx/esx_driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index c2154799fa..03a84d7630 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -1317,6 +1317,8 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr nod= einfo) ++ptr; } =20 + /* Make sure the string fits in mode */ + dynamicProperty->val->string[sizeof(nodeinfo->model) - 1] =3D = '\0'; if (virStrcpyStatic(nodeinfo->model, dynamicProperty->val->str= ing) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("CPU Model %s too long for destination"), --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list