From nobody Sun Feb 8 16:34:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1572960613; cv=none; d=zoho.com; s=zohoarc; b=fJARs6LIkYXrTxW59Ma7oRUsgM6ADIyhx+GRXH8cuPF12huB4gQvav91e8rbWQUbOLeIolb3lsO0jhZJMi1Cpo//4RqR7P8bdZ37iUomI0avwYfe5uMkwnojuoLLxeFZmbi0geoUKho8ez0M9gv89oI0goaus0PpGp+gI+sH2Ds= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572960613; 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=nnbyp97ybDf8ZoJTB/evUBwUBKdrko+tc9IkSWiiRJg=; b=hLqa/uZWAL1/WLhKpjm5Mj82SOebJDAcaqxLg+EAWlgX+VtAcL3egyX2+UfrDm7QCEGRv883acr/xbTHER1ZylngvlyBWc8JW8LjpZ4fBY42ZhBRPY+kqW8zAu2kYItvdZf3PGwhAfy5MPLUMrXcYqIzm0485E84ZGMnqfsG/zA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1572960613341114.14913946797287; Tue, 5 Nov 2019 05:30:13 -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-395-4QZ80xAoPceXcKD6pypSqQ-1; Tue, 05 Nov 2019 08:29:09 -0500 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 856AE800C73; Tue, 5 Nov 2019 13:29:03 +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 5F0665D9CD; Tue, 5 Nov 2019 13:29: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 1C9184EA2D; Tue, 5 Nov 2019 13:29:03 +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 xA5DS2sC004077 for ; Tue, 5 Nov 2019 08:28:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id 284D05C553; Tue, 5 Nov 2019 13:28:02 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1AF05C1B2 for ; Tue, 5 Nov 2019 13:28:01 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 37D0E105D82; Tue, 5 Nov 2019 14:27:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572960612; 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=nnbyp97ybDf8ZoJTB/evUBwUBKdrko+tc9IkSWiiRJg=; b=YeNp1PV1FbmQNjpnUCkXaN/MX3cXFPVjEGfkExKpDpDfXBRiHFtA+DtMUNnGIZYZheKWrJ jWmalqOnEpUyYWWEI5nu+mKIyx+E6gLhMMmcfU/hB6JpmNwy8KOTH4x6PWc/b2t07x7HBs +YZRnwvzybKMjVtx+7AnyyvE1Ko1734= From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 5 Nov 2019 14:27:38 +0100 Message-Id: <4eb4d598b6b0d3b31e87e5040e478d44e240825c.1572958254.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 40/52] qemu: Introduce virQEMUCapsCopyMachineTypes 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 X-MC-Unique: 4QZ80xAoPceXcKD6pypSqQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The function copies machine type data from one QEMU caps structure to another. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 3: - new patch src/qemu/qemu_capabilities.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 0a00f2c361..9376cad6d0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1689,6 +1689,25 @@ virQEMUCapsSEVInfoCopy(virSEVCapabilityPtr *dst, } =20 =20 +static void +virQEMUCapsCopyMachineTypes(virQEMUCapsPtr dst, + virQEMUCapsPtr src) +{ + size_t i; + + dst->machineTypes =3D g_new0(virQEMUCapsMachineType, src->nmachineType= s); + + dst->nmachineTypes =3D src->nmachineTypes; + for (i =3D 0; i < src->nmachineTypes; i++) { + dst->machineTypes[i].name =3D g_strdup(src->machineTypes[i].name); + dst->machineTypes[i].alias =3D g_strdup(src->machineTypes[i].alias= ); + dst->machineTypes[i].maxCpus =3D src->machineTypes[i].maxCpus; + dst->machineTypes[i].hotplugCpus =3D src->machineTypes[i].hotplugC= pus; + dst->machineTypes[i].qemuDefault =3D src->machineTypes[i].qemuDefa= ult; + } +} + + static int virQEMUCapsAccelCopy(virQEMUCapsAccelPtr dst, virQEMUCapsAccelPtr src) @@ -1732,17 +1751,7 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qem= uCaps) virQEMUCapsAccelCopy(&ret->tcg, &qemuCaps->tcg) < 0) goto error; =20 - if (VIR_ALLOC_N(ret->machineTypes, qemuCaps->nmachineTypes) < 0) - goto error; - ret->nmachineTypes =3D qemuCaps->nmachineTypes; - for (i =3D 0; i < qemuCaps->nmachineTypes; i++) { - ret->machineTypes[i].name =3D g_strdup(qemuCaps->machineTypes[i].n= ame); - ret->machineTypes[i].alias =3D g_strdup(qemuCaps->machineTypes[i].= alias); - ret->machineTypes[i].maxCpus =3D qemuCaps->machineTypes[i].maxCpus; - ret->machineTypes[i].hotplugCpus =3D qemuCaps->machineTypes[i].hot= plugCpus; - ret->machineTypes[i].qemuDefault =3D qemuCaps->machineTypes[i].qem= uDefault; - - } + virQEMUCapsCopyMachineTypes(ret, qemuCaps); =20 if (VIR_ALLOC_N(ret->gicCapabilities, qemuCaps->ngicCapabilities) < 0) goto error; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list