From nobody Mon May 6 00:08:40 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=bytedance.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1547471488707782.1152409422641; Mon, 14 Jan 2019 05:11:28 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB6B8539A; Mon, 14 Jan 2019 13:11:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 795D25D73F; Mon, 14 Jan 2019 13:11:22 +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 D1FC0181BA1A; Mon, 14 Jan 2019 13:11:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0EC8Sup010293 for ; Mon, 14 Jan 2019 07:08:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id A0DE55C20D; Mon, 14 Jan 2019 12:08:28 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9850B61D01 for ; Mon, 14 Jan 2019 12:08:26 +0000 (UTC) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) (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 64D50CD4DE for ; Mon, 14 Jan 2019 12:08:23 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id e5so10067688plb.5 for ; Mon, 14 Jan 2019 04:08:23 -0800 (PST) Received: from always-ThinkPad-T480.bytedance.net ([61.120.150.75]) by smtp.gmail.com with ESMTPSA id i5sm402805pfg.34.2019.01.14.04.08.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Jan 2019 04:08:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=lDoFUtg70g9XNMWEvUSjRgfHasv/bUVFRAGAbGEvt6Q=; b=Vbg+OuuOnXof6h6MznoZJpvrq9dmFbVCDbAXtHQsiZhEWsW900gvUpoTHkfAUYkcLc jnQgkarQ2ncpzuVse24Yy3es1RenwiNoOznPUOvgyYexoCxuoSiJu6F2sY2oXpjz/cZx brIt16GyLQXr4leCj01geh4+tApJmBa0ky0Hp8aOqpY+/qfqqUR6PlsYVoEgDiSQ28SB fWVQzZpnN/CYh5OHkW65nJr08Z4WMO9lzc78DUze9ndpbzD/nxMdnPT+/8h7nzC1AVTm XypvJwmdy92dIgLIoSn5riUdLy0WMSmf3s4HFp7dtmanv/GVO3OqlRTsbrKLk7y/nL0W Lpcg== 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=lDoFUtg70g9XNMWEvUSjRgfHasv/bUVFRAGAbGEvt6Q=; b=Gob6pWxQwcrWesvBWgmaeLS92SKsyand3NGMPLc4GP/wueyauucYtetjKI6rWw4Ahj jk99Ei5He+3vIP1vWNNq3EiLgTZWP2yZWeffHI1Fz926DtbaP6/qPVzV2w75tF5Sm8fJ Akrlakq+cbdTIrrabiJAE32SS9sH86KuDVFQXaym1WFcVG0byxDSDavq+Vt3e6z0KjfS vD4f9Iq/ORYIVTc22D5BvxXFiXhjfn6x7Q73V8/hYHDmbP5y1NBJV0CTAPMqHewTPVCF Uk4EtsWHnXO3wZVXddGWWqH2i8Mvf/zttRJfaOh2b7WvjMzRrxUYyWdgLdkFH1lekCTg bhkQ== X-Gm-Message-State: AJcUukfQEiADTjJyDirCv7yVKkitE6iwS8h3+Gjin4CExoUi36fZbqea cXoKhZvSXaTi5TJF8lCOIQY0Oa+fxg4= X-Google-Smtp-Source: ALg8bN44CSKL+f8PZvgrw1P89dZL14bYVDIwQN2CT5cvw+/oN8eSUW4YmHgYRkgNUZKJaCGmg4HuyA== X-Received: by 2002:a17:902:9a9:: with SMTP id 38mr24699984pln.204.1547467702625; Mon, 14 Jan 2019 04:08:22 -0800 (PST) From: zhenwei pi To: berrange@redhat.com, libvir-list@redhat.com Date: Mon, 14 Jan 2019 20:07:34 +0800 Message-Id: <1547467654-7093-1-git-send-email-pizhenwei@bytedance.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 14 Jan 2019 12:08:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 14 Jan 2019 12:08:23 +0000 (UTC) for IP:'209.85.214.194' DOMAIN:'mail-pl1-f194.google.com' HELO:'mail-pl1-f194.google.com' FROM:'pizhenwei@bytedance.com' RCPT:'' X-RedHat-Spam-Score: -0.013 (DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.214.194 mail-pl1-f194.google.com 209.85.214.194 mail-pl1-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Mon, 14 Jan 2019 08:11:17 -0500 Cc: jcfaracco@gmail.com, zhenwei pi Subject: [libvirt] [PATCH] report invalid x86 cpu map error 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 14 Jan 2019 13:11:27 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Let libvirtd handle invalid x86 cpu map error, and report the real reason. This issue can be reproduced : 1, rm -rf /share/libvirt/cpu_map 2, start libvirtd 3, virsh create INSTANCE.xml Libvirtd reports error : error: invalid argument: Failed to parse group 'tss' In face, libvirtd gets invalid cpu map. With this patch, libvirtd reports error : error: unsupported configuration: invalid x86 cpu map Signed-off-by: zhenwei pi --- src/cpu/cpu_x86.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index d3a88da21d..91419d91d4 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2902,8 +2902,11 @@ virCPUx86ValidateFeatures(virCPUDefPtr cpu) virCPUx86MapPtr map; size_t i; =20 - if (!(map =3D virCPUx86GetMap())) + if (!(map =3D virCPUx86GetMap())) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("invalid x86 cpu map")); return -1; + } =20 for (i =3D 0; i < cpu->nfeatures; i++) { if (!x86FeatureFind(map, cpu->features[i].name)) { --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list