From nobody Fri May 17 20:20:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618918091; cv=none; d=zohomail.com; s=zohoarc; b=EQ8DaDUHP/Sd/C+kP7z+pgsMcQgd/AZHyzzpWDom2MMegXaKnn1aueZDpGU9C4OGWYakgNR8qriT8mU1EV0cmfMMi9ydZTpArqPgB7Bk6YG3ITNZ3BnuTMWBK30gmTELQ3zd9F2RuMsKEr+tCH1IF2bAwO1F39mLHZl483R+g0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618918091; 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=LMoLDNzQVDGSBrAQ/xFMb4+g5Re3HNGrRbVcbU+MZwM=; b=Xi4/q1vR45SbWPeyGmd3zSt7H94lMt8o+uL+fCysqq9JdAxV/cfs0OlcbekMxIQ8RhxcxK/409+no/zcdeGxjjyesGONlYInYvdUAVaDPmabS5kDCdYvEfQaRqf4HPj66yi905lo56W/ajKh9L65IN9h2OLdhz9LHw1GIut2kC4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1618918091628854.7112622321408; Tue, 20 Apr 2021 04:28:11 -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-252-iQAk8OFGPWKn3W3bvxtHTQ-1; Tue, 20 Apr 2021 07:28:07 -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 A67C88030D5; Tue, 20 Apr 2021 11:28:02 +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 8342E5D9C0; Tue, 20 Apr 2021 11:28:02 +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 7C6AD180B617; Tue, 20 Apr 2021 11:28:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13KBRwcD018460 for ; Tue, 20 Apr 2021 07:27:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id AC79650AC0; Tue, 20 Apr 2021 11:27:58 +0000 (UTC) Received: from work.redhat.com (ovpn-115-12.ams2.redhat.com [10.36.115.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0275050EDE; Tue, 20 Apr 2021 11:27:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618918090; 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=LMoLDNzQVDGSBrAQ/xFMb4+g5Re3HNGrRbVcbU+MZwM=; b=UetDiT6Z+PDwYYLF7MRbbKanBZF+90M4xzW19qzW1VFXq1eTyhkNFc4rThTfaOO0opIxBA GpDZW54pqDGBvfJeBc93cZYwlxB/VZ1GR7GCjGc5ONA3J/ZObqPBOqstAir1lfB4ikiy3H 8fudwYRchv2Qo5fIjlb4tUQaknk+Uaw= X-MC-Unique: iQAk8OFGPWKn3W3bvxtHTQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 1/4] virxml: Fix schema validation of individual nodes Date: Tue, 20 Apr 2021 13:27:49 +0200 Message-Id: <20210420112752.137256-2-twiederh@redhat.com> In-Reply-To: <20210420112752.137256-1-twiederh@redhat.com> References: <20210420112752.137256-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" xmlDocSetRootElement removes the node from its previous document tree, effectively removing the "" node from "" in virCPUDefParseXML. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/conf/cpu_conf.c | 3 +-- src/util/virxml.c | 13 ++++++------- src/util/virxml.h | 1 - 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index c7bea8ae00..58ca1e2019 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -355,8 +355,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, PKGDATADIR "/schemas"))) return -1; =20 - if (virXMLValidateNodeAgainstSchema(schemafile, ctxt->doc, - ctxt->node) < 0) + if (virXMLValidateNodeAgainstSchema(schemafile, ctxt->node) < 0) return -1; } =20 diff --git a/src/util/virxml.c b/src/util/virxml.c index d0d9494009..418be2a898 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -1551,16 +1551,15 @@ virXMLValidateAgainstSchema(const char *schemafile, =20 =20 int -virXMLValidateNodeAgainstSchema(const char *schemafile, - xmlDocPtr doc, - xmlNodePtr node) +virXMLValidateNodeAgainstSchema(const char *schemafile, xmlNodePtr node) { - xmlNodePtr root; int ret; + xmlDocPtr copy =3D xmlNewDoc(NULL); =20 - root =3D xmlDocSetRootElement(doc, node); - ret =3D virXMLValidateAgainstSchema(schemafile, doc); - xmlDocSetRootElement(doc, root); + xmlDocSetRootElement(copy, xmlCopyNode(node, true)); + ret =3D virXMLValidateAgainstSchema(schemafile, copy); + + xmlFreeDoc(copy); return ret; } =20 diff --git a/src/util/virxml.h b/src/util/virxml.h index 2b40398eee..c0405a39f0 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -296,7 +296,6 @@ virXMLValidateAgainstSchema(const char *schemafile, =20 int virXMLValidateNodeAgainstSchema(const char *schemafile, - xmlDocPtr doc, xmlNodePtr node); =20 void --=20 2.26.3 From nobody Fri May 17 20:20:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618918098; cv=none; d=zohomail.com; s=zohoarc; b=UGG+pLoNA3jm09bs5BB8MwMY4CrnVIixh/IZwPmR0zJmsPhWNgM8JszwDqordGozVMCHCULVVjsgz1w9tqkc/JFMUmEmilI1R4OPaY5g6AJsjPyzTk65exFPNcY9M3EEAETjGp26vboHTt+xdzwea52xB/GTNladSHZBzJkOJVo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618918098; 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=rWlF69aLslI8Pbj/LNkcG3U4qSQi9Hb/NlEbWL6RsKQ=; b=iAdhRGzSG/A3lotIh+1veS6tXPZGnSdmnagVnG+aw34LjqEDDc/9jch8TEdfkQzzHw8Xs+WZvbB0vpqhnW6ICUAiypgWg6mYn6n/ggIqiKuIXw1JRe177LR4lJZuuRKKUcFfpCyUyNnVTYQBr6DfoaXtTSb9GqJZElCUkyvitlY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1618918098346967.9388792771891; Tue, 20 Apr 2021 04:28:18 -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-270-cs4wppmQO0uZVXmYILfbxw-1; Tue, 20 Apr 2021 07:28:15 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A96DA81A281; Tue, 20 Apr 2021 11:28:10 +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 7D9DA1002EE6; Tue, 20 Apr 2021 11:28:10 +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 2EC4744A57; Tue, 20 Apr 2021 11:28:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13KBRxec018468 for ; Tue, 20 Apr 2021 07:27:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id B783E50DDE; Tue, 20 Apr 2021 11:27:59 +0000 (UTC) Received: from work.redhat.com (ovpn-115-12.ams2.redhat.com [10.36.115.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B18F18A60; Tue, 20 Apr 2021 11:27:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618918097; 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=rWlF69aLslI8Pbj/LNkcG3U4qSQi9Hb/NlEbWL6RsKQ=; b=XmXNWOeZbxQnjw8ZG9fElQk25VOlsBQM9T5aGujlT5sLBcuPkgyv5M2KbikmbK33qhh5sQ XrsEvNjRyhrwpmCOc81rI4CfBI2e+VKohZzhCqCEHssAzpFvUryI1d8jk21yJXYpDNHu/i L5Ewe+dg14DhhdbMX921BzhNG1Txhg4= X-MC-Unique: cs4wppmQO0uZVXmYILfbxw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 2/4] xenParseHypervisorFeatures: Remove superfluous VIR_FREE Date: Tue, 20 Apr 2021 13:27:50 +0200 Message-Id: <20210420112752.137256-3-twiederh@redhat.com> In-Reply-To: <20210420112752.137256-1-twiederh@redhat.com> References: <20210420112752.137256-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 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" Fixes: 4eb7c621985dad4de911ec394ac628bd1a5b29ab Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/libxl/xen_common.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index 6fa69fbdf0..aeb94e12ad 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -568,7 +568,6 @@ xenParseHypervisorFeatures(virConf *conf, virDomainDef = *def) timer->mode =3D VIR_DOMAIN_TIMER_MODE_PARAVIRT; =20 def->clock.timers[def->clock.ntimers - 1] =3D timer; - VIR_FREE(tscmode); } =20 if (xenConfigGetString(conf, "passthrough", &passthrough, NULL) < 0) --=20 2.26.3 From nobody Fri May 17 20:20:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1618918159; cv=none; d=zohomail.com; s=zohoarc; b=DsybK9dI0fL8IZnYt4U9sW0gaQWeIwWf6ePuSxQlQjjm5fgoORQ3cdfQ5JttzwpPdD6jXd6D/Wzgy8kY0qmGGiUxq+efYag0RS76RIZvLcSOjW+pbAsZ82bhow7ZOSTXOiH5jxWR/iygLpe2D7ylNMSVGa+ZwOyKPXqCBWKbys0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618918159; 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=6mGb18PifWw722vlxXNctvkT8+Xe8gavqsB725ddqwI=; b=Gyg7oUAedZRcwQpyTH2wDPrVhDf1yquD89/BYG9P+w8gRb+srgBqDCFZqOcpGWgIz5EIygLUnj5iRFO3Ms+F2t0PEgYMPwUchNSWRFQa6dcgGEfLhOKbd+VIcfsHlRRN8Gs1VM0VuN2ooP4XpNAjSiFc4Oa+9NIqpCPxQ5Pd/9w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1618918159756669.460617332602; Tue, 20 Apr 2021 04:29:19 -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-224-D-w9y0G7NIS0oFOA6lKWsg-1; Tue, 20 Apr 2021 07:28:16 -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 92EE9192297D; Tue, 20 Apr 2021 11:28:10 +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 7464D2CC9A; Tue, 20 Apr 2021 11:28:10 +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 2C15285C4; Tue, 20 Apr 2021 11:28:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13KBS0Hm018475 for ; Tue, 20 Apr 2021 07:28:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id BED1718A60; Tue, 20 Apr 2021 11:28:00 +0000 (UTC) Received: from work.redhat.com (ovpn-115-12.ams2.redhat.com [10.36.115.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14FF150DDE; Tue, 20 Apr 2021 11:27:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618918158; 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=6mGb18PifWw722vlxXNctvkT8+Xe8gavqsB725ddqwI=; b=Xiywx4DENOXpQ88bj0WrLmD8hIwAsVZ25y3B7UgFUayY+51HIuDcertpHzBmWF4yFBy+x4 JAZdbiFkQBhlXPOXTt9KarBR6QP5BszfqQrBoChopYcg+zY0jQpOWq7CbqBBaz/j6ecKQW Jf/N6cVL9nRhIVHOmhlt8yt/lfp0E1A= X-MC-Unique: D-w9y0G7NIS0oFOA6lKWsg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 3/4] qemu: Introduce virQEMUCapsUpdateHostCPUModel Date: Tue, 20 Apr 2021 13:27:51 +0200 Message-Id: <20210420112752.137256-4-twiederh@redhat.com> In-Reply-To: <20210420112752.137256-1-twiederh@redhat.com> References: <20210420112752.137256-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Function will be used by next patch. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 9 +++++++++ src/qemu/qemu_capspriv.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 030779902d..7971a9c557 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3819,6 +3819,15 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps, } =20 =20 +void +virQEMUCapsUpdateHostCPUModel(virQEMUCaps *qemuCaps, + virArch hostArch, + virDomainVirtType type) +{ + virQEMUCapsHostCPUDataClear(&virQEMUCapsGetAccel(qemuCaps, type)->host= CPU); + virQEMUCapsInitHostCPUModel(qemuCaps, hostArch, type); +} + qemuMonitorCPUModelInfo * virQEMUCapsGetCPUModelInfo(virQEMUCaps *qemuCaps, virDomainVirtType type) diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index c50b15f193..a54a22685e 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -60,6 +60,10 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps, virArch hostArch, virDomainVirtType type); =20 +void +virQEMUCapsUpdateHostCPUModel(virQEMUCaps *qemuCaps, + virArch hostArch, + virDomainVirtType type); int virQEMUCapsInitCPUModel(virQEMUCaps *qemuCaps, virDomainVirtType type, --=20 2.26.3 From nobody Fri May 17 20:20:10 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=1618918092; cv=none; d=zohomail.com; s=zohoarc; b=AX/OoeHK8bdNwTb7FaU02M3P5Yfuo+skJl7/KaaS21dkscag0kFKc3qzqMpKR3rKq8+cOO93/O7LNOdK0Jf9MNq5/Jh4Rs0VTIsHFuorfOvM6qsDJRYIjyHrGvs5w6RXhfRh0RYnIVtmK6RJDOaf1nlfGxuYWxUoe1RS+/Eem9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618918092; 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=4VG2GsSrA8W0WAVRljDsN/IftuRcQxWo2XnTZvBCrfo=; b=Lh7Sse5hfMj7oFvrwMqqO58jEB2JFuigmMxv8ZkwEiyMzSDFO0nbkSw/pLUIq9fyK6Cm9RC29rY+UM75i/gKNE8QoHfsmg1RbeO/I4K3z/w3j7sJViP2ygSHt3Vv2Yn8tHfPvjeGCXWOfwi/e9xNbrqGpWJbGebOVuktT6Z8Ob8= 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 1618918092811819.0985246446545; Tue, 20 Apr 2021 04:28: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-319-ybUBYyFqMQiT4fhjppycqA-1; Tue, 20 Apr 2021 07:28:09 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3B7FA107ACCD; Tue, 20 Apr 2021 11:28:03 +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 0C63E19726; Tue, 20 Apr 2021 11:28: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 CD149180B652; Tue, 20 Apr 2021 11:28:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13KBS1Hd018489 for ; Tue, 20 Apr 2021 07:28:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id C9D5150DDE; Tue, 20 Apr 2021 11:28:01 +0000 (UTC) Received: from work.redhat.com (ovpn-115-12.ams2.redhat.com [10.36.115.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E2E69CA0; Tue, 20 Apr 2021 11:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618918091; 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=4VG2GsSrA8W0WAVRljDsN/IftuRcQxWo2XnTZvBCrfo=; b=T1nwkDYjsxYSEzgpD8OIbXQh1XdLbLcttZhgXXHPW1Fo7EYopnhzyxp+Jwl04l7Wjnmopv O+czZChcBw9oW357oWcIVONDoSKfl9co5qpJhEKKlVmRl41OwCGoc1Ou92unc2HS6/aaPN Dm3mgGR+VsLBjQX4gy1keUg4tu0a3/Q= X-MC-Unique: ybUBYyFqMQiT4fhjppycqA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 4/4] testUpdateQEMUCaps: Fix memory leak Date: Tue, 20 Apr 2021 13:27:52 +0200 Message-Id: <20210420112752.137256-5-twiederh@redhat.com> In-Reply-To: <20210420112752.137256-1-twiederh@redhat.com> References: <20210420112752.137256-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 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" testUpdateQEMUCaps is called multiple times. Use virQEMUCapsUpdateHostCPUMo= del instead of virQEMUCapsInitHostCPUModel to not overwrite (and leak) the pointers in qemuCaps->kvm.hostCPU and qemuCaps->tcg.hostCPU. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- tests/qemuxml2argvtest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 572c7b251a..f0efe98d7e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -367,10 +367,10 @@ testUpdateQEMUCaps(const struct testQemuInfo *info, !!(info->flags & FLAG_SKIP_LEGACY_CPUS)) < 0) return -1; =20 - virQEMUCapsInitHostCPUModel(info->qemuCaps, caps->host.arch, - VIR_DOMAIN_VIRT_KVM); - virQEMUCapsInitHostCPUModel(info->qemuCaps, caps->host.arch, - VIR_DOMAIN_VIRT_QEMU); + virQEMUCapsUpdateHostCPUModel(info->qemuCaps, caps->host.arch, + VIR_DOMAIN_VIRT_KVM); + virQEMUCapsUpdateHostCPUModel(info->qemuCaps, caps->host.arch, + VIR_DOMAIN_VIRT_QEMU); =20 return 0; } --=20 2.26.3