From nobody Tue Apr 16 10:09:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600263265; cv=none; d=zohomail.com; s=zohoarc; b=NJtFf08ZMAPrw+Qv8QdTFTUytZFIb/wOt51BC5X19zsnccndMJsx50c/yYFOoH1M7WOQIDsr5bw60AJR9MIWtviDO13M86od71ennt7eTpzpnuTj9UpS5TrtehzbGeb+dxZDqkaP5aS/j+uy5B3LhZA3nmAS4ofOsN1DBcA7tEU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600263265; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tBFVemqoLqxFsq6U0XuAoOHjyyKtsIPUfLEW2mJGuwQ=; b=IZTW2lLCRUyU3/Cdyw2sDB7yRZEGycUir0vK1cfNFp57G5LsOdKGV4MO7IIiA3jGE4v9G/vaSZ66jPjeY6nHBi2N5ygWSz8IU1R2blQeCsXt5tU0P/LusHfeLPGx1wTINyXZRX3A65OLMlnJDCkU4+0NAiatb3aPJnHIBTNbhyo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600263265903214.05649807769692; Wed, 16 Sep 2020 06:34:25 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-521-jFTlPbQMPTKIbZibQYrW5A-1; Wed, 16 Sep 2020 09:34:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 729A6190A3ED; Wed, 16 Sep 2020 13:34:16 +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 4F98E5DE86; Wed, 16 Sep 2020 13:34:16 +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 1A9A844A71; Wed, 16 Sep 2020 13:34:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08GDXxkR009283 for ; Wed, 16 Sep 2020 09:34:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id ED5D071775; Wed, 16 Sep 2020 13:33:59 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-217.ams2.redhat.com [10.36.112.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id 35E8E2C31E; Wed, 16 Sep 2020 13:33:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600263264; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=tBFVemqoLqxFsq6U0XuAoOHjyyKtsIPUfLEW2mJGuwQ=; b=Rqyba7dxiqZORu1wK6e617HhPx0z1h0Nc68DblwKu22KxnwI3bHzoy7NY5vzSpGt4ielGR N2jwyZudYGgeAkiaQU5Klx2GqjPxV5FSDvMBFslyBsIdp5rdeEPIH+MKadTyFbwm7vOxm9 +S2FcKbdTVPuFfzf5XZukDojFIgwuFo= X-MC-Unique: jFTlPbQMPTKIbZibQYrW5A-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] tests: Allow cpuTestLoadXML to fail for the guest if we expect it the test to fail Date: Wed, 16 Sep 2020 15:33:54 +0200 Message-Id: <20200916133356.510807-2-twiederh@redhat.com> In-Reply-To: <20200916133356.510807-1-twiederh@redhat.com> References: <20200916133356.510807-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- tests/cputest.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/cputest.c b/tests/cputest.c index 83d63bf495..195a215b84 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -201,13 +201,18 @@ cpuTestCompare(const void *arg) int ret =3D -1; virCPUDefPtr host =3D NULL; virCPUDefPtr cpu =3D NULL; - virCPUCompareResult result; + virCPUCompareResult result =3D VIR_CPU_COMPARE_ERROR; =20 - if (!(host =3D cpuTestLoadXML(data->arch, data->host)) || - !(cpu =3D cpuTestLoadXML(data->arch, data->name))) + if (!(host =3D cpuTestLoadXML(data->arch, data->host))) goto cleanup; =20 - result =3D virCPUCompare(host->arch, host, cpu, false); + if (!(cpu =3D cpuTestLoadXML(data->arch, data->name))) { + if (data->result !=3D VIR_CPU_COMPARE_ERROR) + goto cleanup; + } else { + result =3D virCPUCompare(host->arch, host, cpu, false); + } + if (data->result =3D=3D VIR_CPU_COMPARE_ERROR) virResetLastError(); =20 --=20 2.26.2 From nobody Tue Apr 16 10:09:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600263252; cv=none; d=zohomail.com; s=zohoarc; b=MTC6mrCCM+Vb50dGr5lfV5/vq7/VwpixXvO5S3RBimtHkYSB4t9hkQEEMSbxObhEiYl4zEetcb2fA1C8FP3TfZwvZ4DLURBX4mUkwZXPF9WjCN+PF75qN0zABDFLvWwFqq4wtzqUqEMYmguhOMWt5NeVzmmhfJjKIVO1nGCo1lg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600263252; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1xOd1nwWVO6tlKr6dpdPsCqiNFQSJbm1UcxCOv8EgUI=; b=DxoKF9QW9c9JD5aHLAaV7pjNTFkZzNSVFv4836yd5Dor9sa4SLIoyhtvR061rRDHZJ1HRBCEHTTXZX35r6Q7b91x85ZeRjP9bq35hO+NtRGtjBWZSfWE3ySCx77Jht/GCuDFG/6tlKEm9eNEz3E/tvQN5BMKp/mXxuZd6Hc6sZc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 160026325238088.12537030185467; Wed, 16 Sep 2020 06:34:12 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-228-Lo6qVyv1OFahRIDWG3jxnQ-1; Wed, 16 Sep 2020 09:34:09 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1150A18CBC60; Wed, 16 Sep 2020 13:34:04 +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 D9F437512B; Wed, 16 Sep 2020 13:34:03 +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 9685C44A68; Wed, 16 Sep 2020 13:34:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08GDY1ki009288 for ; Wed, 16 Sep 2020 09:34:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1713C7512B; Wed, 16 Sep 2020 13:34:01 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-217.ams2.redhat.com [10.36.112.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F2F72C31E; Wed, 16 Sep 2020 13:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600263251; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1xOd1nwWVO6tlKr6dpdPsCqiNFQSJbm1UcxCOv8EgUI=; b=aP+T+ALR67WB0eTD2VH4oXSMWp1ewxuK7UbuOqdwj81HOb+cF1tqHOv9zqsPkVMp5Oj7iU C1BaGsT3fq1red6vCrh6diQ5hAgbq0dq5378aWvEqsrFynqure0VjCJ/w8fp8L5CX4OeCq LXVG6j203dn7glXVn/cLEEmRJQPi6Xk= X-MC-Unique: Lo6qVyv1OFahRIDWG3jxnQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] tests: Ensure that cpu comparison fails in the presence of unknown xml elements Date: Wed, 16 Sep 2020 15:33:55 +0200 Message-Id: <20200916133356.510807-3-twiederh@redhat.com> In-Reply-To: <20200916133356.510807-1-twiederh@redhat.com> References: <20200916133356.510807-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- tests/cputest.c | 2 ++ tests/cputestdata/x86_64-bogus-attribute.xml | 2 ++ tests/cputestdata/x86_64-bogus-element.xml | 3 +++ 3 files changed, 7 insertions(+) create mode 100644 tests/cputestdata/x86_64-bogus-attribute.xml create mode 100644 tests/cputestdata/x86_64-bogus-element.xml diff --git a/tests/cputest.c b/tests/cputest.c index 195a215b84..4bfd20dcaf 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -1114,6 +1114,8 @@ mymain(void) /* guest to host comparison */ DO_TEST_COMPARE(VIR_ARCH_X86_64, "host", "bogus-model", VIR_CPU_COMPAR= E_ERROR); DO_TEST_COMPARE(VIR_ARCH_X86_64, "host", "bogus-feature", VIR_CPU_COMP= ARE_ERROR); + DO_TEST_COMPARE(VIR_ARCH_X86_64, "host", "bogus-element", VIR_CPU_COMP= ARE_ERROR); + DO_TEST_COMPARE(VIR_ARCH_X86_64, "host", "bogus-attribute", VIR_CPU_CO= MPARE_ERROR); DO_TEST_COMPARE(VIR_ARCH_X86_64, "host", "min", VIR_CPU_COMPARE_SUPERS= ET); DO_TEST_COMPARE(VIR_ARCH_X86_64, "host", "pentium3", VIR_CPU_COMPARE_S= UPERSET); DO_TEST_COMPARE(VIR_ARCH_X86_64, "host", "exact", VIR_CPU_COMPARE_SUPE= RSET); diff --git a/tests/cputestdata/x86_64-bogus-attribute.xml b/tests/cputestda= ta/x86_64-bogus-attribute.xml new file mode 100644 index 0000000000..073ee793e6 --- /dev/null +++ b/tests/cputestdata/x86_64-bogus-attribute.xml @@ -0,0 +1,2 @@ + + diff --git a/tests/cputestdata/x86_64-bogus-element.xml b/tests/cputestdata= /x86_64-bogus-element.xml new file mode 100644 index 0000000000..79f98bad18 --- /dev/null +++ b/tests/cputestdata/x86_64-bogus-element.xml @@ -0,0 +1,3 @@ + + + --=20 2.26.2 From nobody Tue Apr 16 10:09:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600263254; cv=none; d=zohomail.com; s=zohoarc; b=mVOx87G8ZTGdep/H6xbWGD+Kp6B418EKUGrXWBNKPchc+dqRaZMxUaBQbAGjRiHdaJde9gOPcjG5yfY2J1/AtjvhykuoI10K6C5WN9kuY5L2qnK3vA69uYgRM7mIDit90Du+1wNnKjndDlx+pvDuw8OZKY6A4+BpNkfJ6R8xmtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600263254; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kwBZ087eUNUJoGZ3k5ZYqWrwASNjdCzG+4QDxe/VmWA=; b=jMxZSNfobMU0GeBs92FgMYX/gyzqVji0Ym3XfVk9gDaW2w8f7wlYb3qnPxGz7qcrE5efUXYRendPbLJxVbfrPqOE2vABGSMMbGqM6xRVVJ0sE+OQGd+T2BNwmEQDEVKd5lckA9O+HC7LY0ni4wUHQPmmZwdWJOyoxhhRYeOQNDQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1600263254091156.5436333360866; Wed, 16 Sep 2020 06:34:14 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-151-lR-KIegNNcmDrB24mTYS-w-1; Wed, 16 Sep 2020 09:34:10 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 65FA585C732; Wed, 16 Sep 2020 13:34:04 +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 3E87C7512E; Wed, 16 Sep 2020 13:34:04 +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 03B6F183D02F; Wed, 16 Sep 2020 13:34:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08GDY26m009301 for ; Wed, 16 Sep 2020 09:34:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 308EC71775; Wed, 16 Sep 2020 13:34:02 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-217.ams2.redhat.com [10.36.112.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id 695322C31E; Wed, 16 Sep 2020 13:34:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600263253; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=kwBZ087eUNUJoGZ3k5ZYqWrwASNjdCzG+4QDxe/VmWA=; b=jJCXTtxRbSRysavoNCCnbjqP26w+q+B/CBdPHsaHmhITcPhaNgMoKrXRLA6DX+oarV7AiZ G4sOT6zFSznOkJkMag/woLNDzc/oVBl0UXjXqxYWHoDbfSJlPV06otUGbMTvUuxTv7/7q2 XGCgwf6vZCdQ4PKR+rodCzmeiaGCr2I= X-MC-Unique: lR-KIegNNcmDrB24mTYS-w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] cpu: Fail CPU comparison in the presence of unknown elements. Date: Wed, 16 Sep 2020 15:33:56 +0200 Message-Id: <20200916133356.510807-4-twiederh@redhat.com> In-Reply-To: <20200916133356.510807-1-twiederh@redhat.com> References: <20200916133356.510807-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- src/conf/cpu_conf.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index dea950ce68..a2ba92ced3 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -659,6 +659,44 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, def->cache->mode =3D mode; } =20 + g_clear_pointer(&nodes, g_free); + if ((n =3D virXPathNodeSet("./@*", ctxt, &nodes)) < 0) + return -1; + + for (i =3D 0; i < n; i++) { + if (virXMLNodeNameEqual(nodes[i], "check") || + virXMLNodeNameEqual(nodes[i], "match") || + virXMLNodeNameEqual(nodes[i], "migratable") || + virXMLNodeNameEqual(nodes[i], "mode")) + continue; + virReportError(VIR_ERR_XML_ERROR, + _("unrecognized attribute in cpu element: %s"), + nodes[i]->name); + return -1; + } + + g_clear_pointer(&nodes, g_free); + if ((n =3D virXPathNodeSet("./*", ctxt, &nodes)) < 0) + return -1; + + for (i =3D 0; i < n; i++) { + if (virXMLNodeNameEqual(nodes[i], "arch") || + virXMLNodeNameEqual(nodes[i], "cache") || + virXMLNodeNameEqual(nodes[i], "counter") || + virXMLNodeNameEqual(nodes[i], "feature") || + virXMLNodeNameEqual(nodes[i], "model") || + virXMLNodeNameEqual(nodes[i], "microcode") || + virXMLNodeNameEqual(nodes[i], "numa") || + virXMLNodeNameEqual(nodes[i], "pages") || + virXMLNodeNameEqual(nodes[i], "topology") || + virXMLNodeNameEqual(nodes[i], "vendor")) + continue; + virReportError(VIR_ERR_XML_ERROR, + _("unrecognized element in cpu element: %s"), + nodes[i]->name); + return -1; + } + *cpu =3D g_steal_pointer(&def); return 0; } --=20 2.26.2