From nobody Mon Feb 9 00:56:17 2026 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=1612885400; cv=none; d=zohomail.com; s=zohoarc; b=bl0GL3cFHIhG9FF1r9mHctagKlC3pmf5/upHkdE8f8Qferb5McHIAU4JWRe18MKgn/YxJ7lpaetvTRMTo9D5ktvKyeWYQmVXDn+iJXJ6KOXXw7fQPyYuUiAOo9S4TpDUWk+P/bnzcH1D4gRuZDFw7lAhiUWG7tYwk2zKJosey0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612885400; h=Content-Type:Content-Transfer-Encoding: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=Hahvxqw6xrsTZKvGO/v4MG+6wdu4i1SaVaSprWgEzJg=; b=geNq1BH5benAq3t5S345KIB6N7gacBFmaEWIxiP0B+k46z7emMN2UdX1us3xPxSjLS/tDjDMMSP9ik2c8yDOZHU0fOMzhB0m5/3+qwkcw1CamhxncgtVMFfAwcpGB9SrRFRo6O8Y6B3EEmnVuXNdEcNDnTw7E47Jl0iHbUSdvBM= 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 161288540031919.32080101042459; Tue, 9 Feb 2021 07:43:20 -0800 (PST) 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-361-ctki5Wm_Oe2kvffZ5MvWHw-1; Tue, 09 Feb 2021 10:43:16 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B789D107ACE6; Tue, 9 Feb 2021 15:43:10 +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 877A960C5E; Tue, 9 Feb 2021 15:43: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 3CB4A18095CE; Tue, 9 Feb 2021 15:43:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 119Fgj35007903 for ; Tue, 9 Feb 2021 10:42:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id A126E1412A; Tue, 9 Feb 2021 15:42:45 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 214BD60861 for ; Tue, 9 Feb 2021 15:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612885399; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=Hahvxqw6xrsTZKvGO/v4MG+6wdu4i1SaVaSprWgEzJg=; b=FPhvWwTG2AYx888Pg2bMHQsDZ5DKK8S/yvqemXK/51lDly/5LvzxZElQthQ3OXC7aBYwZc OtK9qcYs3Zgb4r2ZmChRVlHWsasuHXdwMTLwm0PEHskvY2lbYuektIXp+APWyDjlu7s3TL DoXoWQYdeqd+CAQdlKcE6+QoydUWr1E= X-MC-Unique: ctki5Wm_Oe2kvffZ5MvWHw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] qemu_capabilities: Parse "deprecated" in virQEMUCapsLoadMachines() properly Date: Tue, 9 Feb 2021 16:42:38 +0100 Message-Id: <42c8ec991e80d9fdfbae90aa56272b31554e9589.1612885330.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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.13 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" A element can have "deprecated" attribute that corresponds to 'deprecated' member of _virQEMUCapsMachineType struct. But the member is of boolean type. Therefore, the string returned by virXMLPropString() must be freed. Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_capabilities.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 4a6ef2e383..ebd6607888 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4063,7 +4063,11 @@ virQEMUCapsLoadMachines(virQEMUCapsAccelPtr caps, =20 caps->machineTypes[i].defaultCPU =3D virXMLPropString(nodes[i], "d= efaultCPU"); caps->machineTypes[i].defaultRAMid =3D virXMLPropString(nodes[i], = "defaultRAMid"); - caps->machineTypes[i].deprecated =3D virXMLPropString(nodes[i], "d= eprecated"); + + str =3D virXMLPropString(nodes[i], "deprecated"); + if (STREQ_NULLABLE(str, "yes")) + caps->machineTypes[i].deprecated =3D true; + VIR_FREE(str); } =20 return 0; --=20 2.26.2