From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153741; cv=none; d=zoho.com; s=zohoarc; b=eqVkF8jJbt7mq0dVotMLJILfzXh7JGQflsfMLnUXQp5vwvwdZnuiIUchxwrlxPpawA1I9MBgYPinTzT9OC/wS224NXwa6pwfoyPKYndBqAv6k7xEp7ymqgwe0dyK/5FV1DJAvQfyRYgL4wayV66jhphOUhkFWnRQXQiDFhCP+6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153741; 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=Vt49A5QzpnVSPlC6Ha1etmCiQI6rAk06ZZroDwkK9RQ=; b=IFT7W049Hwsq4IqgxoKBqtun/mEpI8ZpZ9241UcgL1QG2+MxPFyyqSIDhlj0/CFxTsb2hWcOWOpH849imFF7wCkaIKjeIjLLFd9LMJeMSE08NOIubsiQKTnNQdRx33LtrRNdPLSKjxeV0/1sKiW2xtQ1shJuyrZB8YLCbBJu/Sw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153741316368.3739652346927; Tue, 15 Oct 2019 08:35:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5637B2A09CC; Tue, 15 Oct 2019 15:35:39 +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 27CBE60FA2; Tue, 15 Oct 2019 15:35:39 +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 CD45B180BA9D; Tue, 15 Oct 2019 15:35:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZDrp024603 for ; Tue, 15 Oct 2019 11:35:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 42F1860C5E; Tue, 15 Oct 2019 15:35:13 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 174E860BE2 for ; Tue, 15 Oct 2019 15:35:10 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 2000C10017D; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:37 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 01/31] tests: Add capabilities for QEMU 4.2.0 on s390x 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: , 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 15 Oct 2019 15:35:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - new patch .../caps_4.2.0.s390x.replies | 22414 ++++++++++++++++ .../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 3345 +++ 2 files changed, 25759 insertions(+) create mode 100644 tests/qemucapabilitiesdata/caps_4.2.0.s390x.replies create mode 100644 tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.replies b/tests/qe= mucapabilitiesdata/caps_4.2.0.s390x.replies new file mode 100644 index 0000000000..68d70de415 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_4.2.0.s390x.replies @@ -0,0 +1,22414 @@ +{ + "execute": "qmp_capabilities", + "id": "libvirt-1" +} + +{ + "return": { + }, + "id": "libvirt-1" +} + +{ + "execute": "query-version", + "id": "libvirt-2" +} + +{ + "return": { + "qemu": { + "micro": 50, + "minor": 1, + "major": 4 + }, + "package": "v4.1.0-1484-g3779d18011" + }, + "id": "libvirt-2" +} ... diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml b/tests/qemuca= pabilitiesdata/caps_4.2.0.s390x.xml new file mode 100644 index 0000000000..1c9a383816 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml @@ -0,0 +1,3345 @@ + + 0 + 0 + 0 + ... --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153721; cv=none; d=zoho.com; s=zohoarc; b=RHkmI4pNCK+byLavwNNphjss0kIrSHcCqkwKpljKx6RnReoZqmPJAmRUXCH1IMYY+OpbhnMzgLj/kER1ATcTslpnzSbAAUqwsOdz++h/jzenDHI23kH58Y2xV5UV2oZHpzBT87KJDxrwjc6mGmqtkL4eA9SBLZUOpyBOXWTHSUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153721; 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=4CJlNqjvqdYILUZepIi/m8dLMtXiyW6xDoE7859e2qY=; b=JuZx813ROmLbek6Ti2pJIoWi9E5ZNpokP3lK4a+6vQudxHxrh5IVGXtatXyn2h9UGWyJ4GGjGGkL0s6koSOdi2bzr4+53ZlvrkC9NlDpVvXzF6xWxPkz/2uU74p1JoHQxrwn8orJJRcGyrrHO2xzENlFA2diXDwLVtRRJGGXSFo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153721085808.3913497125659; Tue, 15 Oct 2019 08:35:21 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id AAA1C10DCC8F; Tue, 15 Oct 2019 15:35:18 +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 45CA6194BB; Tue, 15 Oct 2019 15:35:18 +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 95D124EE96; Tue, 15 Oct 2019 15:35:14 +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 x9FFZDxp024602 for ; Tue, 15 Oct 2019 11:35:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3C7525C1D6; Tue, 15 Oct 2019 15:35:13 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DF1B25C1D4 for ; Tue, 15 Oct 2019 15:35:10 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 232FF101A87; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:38 +0200 Message-Id: <6ebca1dae7262a8ebcd7cc5f1510ed74bfe4715c.1571152057.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 v2 02/31] domcapstest: Add test case for QEMU 4.2.0 on s390x 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.64]); Tue, 15 Oct 2019 15:35:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - new patch .../domaincapsschemadata/qemu_4.2.0.s390x.xml | 202 ++++++++++++++++++ tests/domaincapstest.c | 4 + 2 files changed, 206 insertions(+) create mode 100644 tests/domaincapsschemadata/qemu_4.2.0.s390x.xml diff --git a/tests/domaincapsschemadata/qemu_4.2.0.s390x.xml b/tests/domain= capsschemadata/qemu_4.2.0.s390x.xml new file mode 100644 index 0000000000..1ca3b78251 --- /dev/null +++ b/tests/domaincapsschemadata/qemu_4.2.0.s390x.xml @@ -0,0 +1,202 @@ + + /usr/bin/qemu-system-s390x + kvm + s390-ccw-virtio-4.2 + s390x + + + + + + /usr/share/AAVMF/AAVMF_CODE.fd + /usr/share/AAVMF/AAVMF32_CODE.fd + /usr/share/OVMF/OVMF_CODE.fd + + rom + pflash + + + yes + no + + + no + + + + + + + z13.2-base + + + + + + + + + + + + + + + + + + + + + + + + + + + z800-base + z890.2-base + z9EC.2 + z13.2 + z990.5-base + z9BC-base + z890.2 + z890 + z9BC + z13 + z196 + z13s + z990.3 + z13s-base + z9EC + gen15a + z14ZR1-base + z14.2-base + z900.3-base + z13.2-base + z196.2-base + zBC12-base + z9BC.2-base + z900.2-base + z9EC.3 + zEC12 + z900 + z114-base + zEC12-base + z10EC.2 + z10EC-base + z900.3 + z14ZR1 + z10BC + z10BC.2-base + z9BC.2 + z990.2 + z990 + z14 + gen15b-base + z990.4 + max + z10EC.2-base + gen15a-base + z800 + zEC12.2 + z10EC + z990.2-base + z900-base + z10BC.2 + z9EC-base + z9EC.3-base + z114 + z890.3 + z196-base + z9EC.2-base + z196.2 + z990-base + z14.2 + z900.2 + z890-base + z10EC.3 + z14-base + z990.4-base + z10EC.3-base + z10BC-base + z13-base + z990.3-base + zEC12.2-base + zBC12 + z890.3-base + z990.5 + gen15b + qemu + + + + + + disk + cdrom + floppy + lun + + + fdc + scsi + virtio + + + virtio + virtio-transitional + virtio-non-transitional + + + + + sdl + vnc + + + + + + subsystem + + + default + mandatory + requisite + optional + + + usb + pci + scsi + + + + default + vfio + + + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + + + + + + + + + diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index db14114cba..667311c2bd 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -468,6 +468,10 @@ mymain(void) "/usr/bin/qemu-system-aarch64", NULL, "aarch64", VIR_DOMAIN_VIRT_KVM); =20 + DO_TEST_QEMU("4.2.0", "caps_4.2.0", + "/usr/bin/qemu-system-s390x", NULL, + "s390x", VIR_DOMAIN_VIRT_KVM); + virObjectUnref(cfg); =20 virFileWrapperClearPrefixes(); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153733; cv=none; d=zoho.com; s=zohoarc; b=Exvu1U1bqWJjwxafzYypq0iQTnxvkcdYQwzcjKuZwOrTSxLklBiI8NpIP9fGhWuif8EaEr1L8Ma0hnDL9YTVuc9KofCpJmi62CS+OSswwRDsNBLsSuZcZppSlmxQ1YoeZxgPRjGalGZHmXxLPaujEIDq0jpSp3p4GaOKfqeI7kA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153733; 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=eD3TTohCuhwJB/WGn3+Kol6ljn6iRf4jCzHyCk2Jvck=; b=UxbSGkgqBUDDEcKh22eXsL6tWKsQDhmVtWiz2PrVXiy6jNdNQFNYJwTomBEQ1mfvoYNwpV9Vkcfd70LrOgROGLg0Jqz3JjPe7xEWbehV8/DCRW82VB+TRw9ESF2XCbOp8x4ebSXPHGmKU+G+ifvl1+xLIMT7L3cE59euENtDGzM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153733332283.38417859527044; Tue, 15 Oct 2019 08:35:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 778AF20E4; Tue, 15 Oct 2019 15:35:31 +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 451BA60127; Tue, 15 Oct 2019 15:35:31 +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 CD58518005A0; Tue, 15 Oct 2019 15:35:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZDml024604 for ; Tue, 15 Oct 2019 11:35:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4309F60C63; Tue, 15 Oct 2019 15:35:13 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1794F60C57 for ; Tue, 15 Oct 2019 15:35:10 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 25CE9101A88; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:39 +0200 Message-Id: <6781e3eca06be27696068263d2ebfa90555cd4fd.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 03/31] conf: Use VIR_AUTO* in virDomainCapsCPUModelsAdd 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: , Content-Type: text/plain; charset="utf-8" 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Tue, 15 Oct 2019 15:35:32 +0000 (UTC) Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/conf/domain_capabilities.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index b0fdd15d6c..3224ec3f52 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -246,25 +246,20 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr c= puModels, virDomainCapsCPUUsable usable, char **blockers) { - char *nameCopy =3D NULL; - char **blockersCopy =3D NULL; + VIR_AUTOFREE(char *) nameCopy =3D NULL; + VIR_AUTOSTRINGLIST blockersCopy =3D NULL; =20 if (VIR_STRNDUP(nameCopy, name, nameLen) < 0) - goto error; + return -1; =20 if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0) - goto error; + return -1; =20 if (virDomainCapsCPUModelsAddSteal(cpuModels, &nameCopy, usable, &blockersCopy) < 0) - goto error; + return -1; =20 return 0; - - error: - VIR_FREE(nameCopy); - virStringListFree(blockersCopy); - return -1; } =20 =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153821; cv=none; d=zoho.com; s=zohoarc; b=MjE1ycKgg9eQsLD7kkqOWmgow32r5uWpl2+ywdTWxDxH3UGkCjW7xtEXfSu6RcQNjcJFu8ji4FiZAv2n5Z7UCIndT1HLkwASLRx1PCIt5yG4BCYWiJUvlkgDzTxGobvhDlUhx941unSPFBbNrVwXJzELxsrmR1CzGvVFVeX0CZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153821; 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=P/9rHWroUaeS2TsKlHRJsKVHv7daqB9qQBel0pfkA/c=; b=IyPQ7xjGIzFggrnlTOsNXpIoqz4O1N9xK0DBbN1pvUkEX1PEGBHLYw05L+gYP1FbJX4GgWSJRvTRIRfI/+65iWs9DcVxrQaQHSdpgQIxgDfebYvx7SkkNxh2MCL2Yv67kN++sSqYFP6bZ/lFpOaXOyr1fN4KT/kqhXHZMB1//b8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153821145741.6091654011616; Tue, 15 Oct 2019 08:37:01 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 782BF316E533; Tue, 15 Oct 2019 15:36:59 +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 50CA5100EBD3; Tue, 15 Oct 2019 15:36:59 +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 13FF11803B48; Tue, 15 Oct 2019 15:36:59 +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 x9FFZDiO024597 for ; Tue, 15 Oct 2019 11:35:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 12DA45D6A9; Tue, 15 Oct 2019 15:35:13 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DBC8C5D6B0 for ; Tue, 15 Oct 2019 15:35:10 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 28AC2101A89; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:40 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 04/31] conf: Drop nameLen parameter from virDomainCapsCPUModelsAdd 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 15 Oct 2019 15:36:59 +0000 (UTC) All callers use nameLen =3D=3D -1 anyway. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/conf/domain_capabilities.c | 7 +++---- src/conf/domain_capabilities.h | 1 - src/qemu/qemu_capabilities.c | 2 +- tests/cputest.c | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 3224ec3f52..ab8ebb650d 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -171,7 +171,7 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr ol= d) =20 for (i =3D 0; i < old->nmodels; i++) { if (virDomainCapsCPUModelsAdd(cpuModels, - old->models[i].name, -1, + old->models[i].name, old->models[i].usable, old->models[i].blockers) < 0) goto error; @@ -204,7 +204,7 @@ virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr = old, continue; =20 if (virDomainCapsCPUModelsAdd(cpuModels, - old->models[i].name, -1, + old->models[i].name, old->models[i].usable, old->models[i].blockers) < 0) goto error; @@ -242,14 +242,13 @@ virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModels= Ptr cpuModels, int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, - ssize_t nameLen, virDomainCapsCPUUsable usable, char **blockers) { VIR_AUTOFREE(char *) nameCopy =3D NULL; VIR_AUTOSTRINGLIST blockersCopy =3D NULL; =20 - if (VIR_STRNDUP(nameCopy, name, nameLen) < 0) + if (VIR_STRDUP(nameCopy, name) < 0) return -1; =20 if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0) diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 3a92194602..e3bd8d423e 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -204,7 +204,6 @@ int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUMode= lsPtr cpuModels, char ***blockers); int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, - ssize_t nameLen, virDomainCapsCPUUsable usable, char **blockers); virDomainCapsCPUModelPtr diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index efd71d69c5..14939fc91d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1879,7 +1879,7 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, } =20 for (i =3D 0; i < count; i++) { - if (virDomainCapsCPUModelsAdd(cpus, name[i], -1, usable, NULL) < 0) + if (virDomainCapsCPUModelsAdd(cpus, name[i], usable, NULL) < 0) return -1; } =20 diff --git a/tests/cputest.c b/tests/cputest.c index e3937c6fd6..7f47e3b601 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -863,7 +863,7 @@ cpuTestUpdateLive(const void *arg) usable =3D hvModel->usable; } =20 - if (virDomainCapsCPUModelsAdd(models, expected->model, -1, + if (virDomainCapsCPUModelsAdd(models, expected->model, usable, blockers) < 0) goto cleanup; =20 @@ -973,7 +973,7 @@ cpuTestInitModels(const char **list) return NULL; =20 for (model =3D list; *model; model++) { - if (virDomainCapsCPUModelsAdd(cpus, *model, -1, + if (virDomainCapsCPUModelsAdd(cpus, *model, VIR_DOMCAPS_CPU_USABLE_UNKNOWN, NULL= ) < 0) goto error; } --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153744; cv=none; d=zoho.com; s=zohoarc; b=bLoLE3N8Nt7609pzJIx4y03UHnHahQjWZTBxPvtb4jnsncCpe5RUGslkVuLwrymOYcJVgxu7kDAl6JWA76TTqSelbzTqJWJsvMKk//a4tZicvmUeVMEn9RUKWtAhk2lgXIgk5f7YkoYJNkX5WTfVzx22J/nLWM5OQiw9uW1IMis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153744; 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=HAF010+M3Y3MDRHg3JUlyNSj8ZyNOWnM7CLo4whDi90=; b=HCwc3Fd8EM/9nJ3dW/gyvz6ODp4lUQBlrWngFQaBopyTOdQv4OvwCSf5am6Qp9Ld9nGP7DtwwCToD3VyzhpMD1/DpmwhhuXxMGyV0lTATCJKgsIa5OIGxQr5ypFlzQAuSLx6vpzxoFTEyn0HRoZesFKqHXgzcPzmHzYuFd+q2ZQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153744841100.92967034959747; Tue, 15 Oct 2019 08:35:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4BB9F302C08E; Tue, 15 Oct 2019 15:35:43 +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 1F61C60C80; Tue, 15 Oct 2019 15:35:43 +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 C755662D10; Tue, 15 Oct 2019 15:35:42 +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 x9FFZEla024626 for ; Tue, 15 Oct 2019 11:35:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id CE8D45D6B0; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7DB3F5D6A9 for ; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 2B83E101A8A; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:41 +0200 Message-Id: <675aa339fe8214acd99c46938c520f5437c4b1a3.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 05/31] qemu: Copy CPU models in virQEMUCapsGetCPUDefinitions 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: , Content-Type: text/plain; charset="utf-8" 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 15 Oct 2019 15:35:43 +0000 (UTC) Rather than returning a direct pointer the list stored in qemuCaps the function now creates a new copy of the CPU models list. The main purpose of this seemingly useless change is to update callers to free the result returned by virQEMUCapsGetCPUDefinitions because the internals of this function will change significantly in the following patches. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/qemu/qemu_capabilities.c | 23 ++++++++++++++++++----- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_process.c | 7 +++++-- tests/cputest.c | 1 - 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 14939fc91d..a40bf99aa3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1891,10 +1891,17 @@ virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, virDomainVirtType type) { + virDomainCapsCPUModelsPtr cpuModels; + if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - return qemuCaps->kvmCPUModels; + cpuModels =3D qemuCaps->kvmCPUModels; else - return qemuCaps->tcgCPUModels; + cpuModels =3D qemuCaps->tcgCPUModels; + + if (!cpuModels) + return NULL; + + return virDomainCapsCPUModelsCopy(cpuModels); } =20 =20 @@ -3125,6 +3132,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, virCPUDefPtr cpu, bool migratable) { + VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels =3D NULL; virCPUDataPtr data =3D NULL; int ret =3D -1; =20 @@ -3134,7 +3142,9 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, if (!(data =3D virQEMUCapsGetCPUModelX86Data(qemuCaps, model, migratab= le))) goto cleanup; =20 - if (cpuDecode(cpu, data, virQEMUCapsGetCPUDefinitions(qemuCaps, type))= < 0) + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type); + + if (cpuDecode(cpu, data, cpuModels) < 0) goto cleanup; =20 ret =3D 0; @@ -3217,10 +3227,13 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, if ((rc =3D virQEMUCapsInitCPUModel(qemuCaps, type, cpu, false)) < 0) { goto error; } else if (rc =3D=3D 1) { + VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels =3D NULL; + VIR_DEBUG("No host CPU model info from QEMU; probing host CPU dire= ctly"); =20 - hostCPU =3D virQEMUCapsProbeHostCPU(hostArch, - virQEMUCapsGetCPUDefinitions(qem= uCaps, type)); + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type); + hostCPU =3D virQEMUCapsProbeHostCPU(hostArch, cpuModels); + if (!hostCPU || virCPUDefCopyModelFilter(cpu, hostCPU, true, virQEMUCapsCPUFilterFeatures, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6ce6348593..15c69667a5 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13913,7 +13913,7 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn, virQEMUCapsPtr qemuCaps =3D NULL; virArch arch; virDomainVirtType virttype; - virDomainCapsCPUModelsPtr cpuModels; + VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels =3D NULL; bool migratable; virCPUDefPtr cpu =3D NULL; char *cpustr =3D NULL; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9c50c4a1d8..58192612b0 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6122,6 +6122,8 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, =20 /* nothing to update for host-passthrough */ if (def->cpu->mode !=3D VIR_CPU_MODE_HOST_PASSTHROUGH) { + VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels =3D NULL; + if (def->cpu->check =3D=3D VIR_CPU_CHECK_PARTIAL && virCPUCompare(caps->host.arch, virQEMUCapsGetHostModel(qemuCaps, def->virtType, @@ -6134,8 +6136,9 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, VIR_QEMU_CAPS_HOST_CPU_MI= GRATABLE)) < 0) return -1; =20 - if (virCPUTranslate(def->os.arch, def->cpu, - virQEMUCapsGetCPUDefinitions(qemuCaps, def->vi= rtType)) < 0) + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType= ); + + if (virCPUTranslate(def->os.arch, def->cpu, cpuModels) < 0) return -1; =20 def->cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; diff --git a/tests/cputest.c b/tests/cputest.c index 7f47e3b601..3aa8fd7bf3 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -551,7 +551,6 @@ cpuTestGetCPUModels(const struct data *data, return -1; =20 *models =3D virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM= ); - virObjectRef(*models); =20 virObjectUnref(qemuCaps); =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153825; cv=none; d=zoho.com; s=zohoarc; b=WBQdDkAlEWdBeSAUfNxHr3aYiTC20eM8Acs0WF5KZsvFeNanunqfNSYcp6viHM8vwVexh4d7ADEXjTNnN8jKYF7C/XE1yYGXcWkmi6aYp2E0LZ+cDNY1lumNO+3LvwnKgXWUQccEZL5fKAMv9KOxafr+itIjwMDJLRDctaHcKDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153825; 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=AKACQ042J0VKbJ3zVlu8H69plft8IwCf4r+kdPk09Ds=; b=GEYJtdEFk6OWnGrl2IRgASlbxCwvyvOCTxrzFozxqMJ1OE2i2l6nB6VofncUSZSSKWTWizfydMAypkmgNJQOFkAFb70Vag+69Al1qJ1zFuQspPUCWV/F2USkfeO/jKAAyu071u9b0VuiPO0TrtparNTdmsF8+x6FcwJXlyjbzb0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153825476506.62352445314923; Tue, 15 Oct 2019 08:37:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B633620E4; Tue, 15 Oct 2019 15:37: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 18B9D5FCDF; Tue, 15 Oct 2019 15:37: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 CE8861803B4C; Tue, 15 Oct 2019 15:37:02 +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 x9FFZEMw024625 for ; Tue, 15 Oct 2019 11:35:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id CD1635C1D6; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C6435C1D4 for ; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 2E4DC101CCF; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:42 +0200 Message-Id: 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 v2 06/31] qemu: Filter models in virQEMUCapsGetCPUDefinitions 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: , Content-Type: text/plain; charset="utf-8" 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Tue, 15 Oct 2019 15:37:04 +0000 (UTC) Some callers of virQEMUCapsGetCPUDefinitions will need to filter the returned list of CPU models. Let's add the filtering parameters directly to virQEMUCapsGetCPUDefinitions to avoid copying the CPU models list twice. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/qemu/qemu_capabilities.c | 11 ++++++++--- src/qemu/qemu_capabilities.h | 4 +++- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_process.c | 2 +- tests/cputest.c | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a40bf99aa3..e6a7ee4f14 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1889,7 +1889,9 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, =20 virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, - virDomainVirtType type) + virDomainVirtType type, + const char **modelWhitelist, + const char **modelBlacklist) { virDomainCapsCPUModelsPtr cpuModels; =20 @@ -1901,6 +1903,9 @@ virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, if (!cpuModels) return NULL; =20 + if (modelWhitelist || modelBlacklist) + return virDomainCapsCPUModelsFilter(cpuModels, modelWhitelist, mod= elBlacklist); + return virDomainCapsCPUModelsCopy(cpuModels); } =20 @@ -3142,7 +3147,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, if (!(data =3D virQEMUCapsGetCPUModelX86Data(qemuCaps, model, migratab= le))) goto cleanup; =20 - cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type); + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type, NULL, NULL); =20 if (cpuDecode(cpu, data, cpuModels) < 0) goto cleanup; @@ -3231,7 +3236,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, =20 VIR_DEBUG("No host CPU model info from QEMU; probing host CPU dire= ctly"); =20 - cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type); + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type, NULL, N= ULL); hostCPU =3D virQEMUCapsProbeHostCPU(hostArch, cpuModels); =20 if (!hostCPU || diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 10f0ce2654..67dccc522e 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -570,7 +570,9 @@ int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCap= s, size_t count, virDomainCapsCPUUsable usable); virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemu= Caps, - virDomainVirtType t= ype); + virDomainVirtType t= ype, + const char **modelW= hitelist, + const char **modelB= lacklist); virDomainCapsCPUModelsPtr virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mo= n, virArch arch); =20 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 15c69667a5..802f07fe92 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13939,7 +13939,7 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn, if (!qemuCaps) goto cleanup; =20 - if (!(cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, virttype)) = || + if (!(cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, virttype, N= ULL, NULL)) || cpuModels->nmodels =3D=3D 0) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("QEMU '%s' does not support any CPU models for " diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 58192612b0..f37acab9e4 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6136,7 +6136,7 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, VIR_QEMU_CAPS_HOST_CPU_MI= GRATABLE)) < 0) return -1; =20 - cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType= ); + cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType= , NULL, NULL); =20 if (virCPUTranslate(def->os.arch, def->cpu, cpuModels) < 0) return -1; diff --git a/tests/cputest.c b/tests/cputest.c index 3aa8fd7bf3..4428d451cf 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -550,7 +550,7 @@ cpuTestGetCPUModels(const struct data *data, if (!(qemuCaps =3D cpuTestMakeQEMUCaps(data))) return -1; =20 - *models =3D virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM= ); + *models =3D virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM= , NULL, NULL); =20 virObjectUnref(qemuCaps); =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153759; cv=none; d=zoho.com; s=zohoarc; b=ZcjydYwkvP47GpmZ8czpXkGepS6wCbVFSyAjOvdSG1Upmv9EA/ZQuVlHcU5F1kp9+j6OwOO6G9xajh3s2X0LPYNMw5w0VyWyqQdLNj+dx246UUghJktPjt6CBJ1Olp6vsDr6QnDfhSxtUMQqGdBYwrDvUsYbxuG7Uyq3vWXAh5A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153759; 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=ku1rthZlXj2BMWmdfmb72EGLYVtz+TdOASGV4H2h3pc=; b=gGc6gLJ5+nZyk4rvjoIN7250jEIO9081Juxo+djYHBR1wj86qrznvW5lBHz4TezyRrSVI2zzwlmPuu4Krui4LBi38JmA4wy5sokzZRA0V05ouE0uZOGmFV1GB5v3zMgmfBQflovgEKfihdlfJYK5AjQjfFmeZox3N7H7BlMWAkw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153759851867.441867635226; Tue, 15 Oct 2019 08:35:59 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 0F2B718C893A; Tue, 15 Oct 2019 15:35:58 +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 D8026100EBA3; Tue, 15 Oct 2019 15:35:57 +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 8A72E6B4B3; Tue, 15 Oct 2019 15:35:57 +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 x9FFZHfg024702 for ; Tue, 15 Oct 2019 11:35:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 350C260A97; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09D9F608C0 for ; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 31201101CD4; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:43 +0200 Message-Id: <6d7330878571e3b3e89ceb632c7d56f03fa493df.1571152057.git.jdenemar@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 Subject: [libvirt] [PATCH v2 07/31] qemu: Use virQEMUCapsGetCPUDefinitions more 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Tue, 15 Oct 2019 15:35:58 +0000 (UTC) Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/qemu/qemu_capabilities.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e6a7ee4f14..b608eb1a43 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5297,24 +5297,17 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps, =20 if (virQEMUCapsIsCPUModeSupported(qemuCaps, caps, domCaps->virttype, VIR_CPU_MODE_CUSTOM)) { - virDomainCapsCPUModelsPtr filtered =3D NULL; - char **models =3D NULL; const char *blacklist[] =3D { "host", NULL }; + VIR_AUTOSTRINGLIST models =3D NULL; =20 if (virCPUGetModels(domCaps->arch, &models) >=3D 0) { - virDomainCapsCPUModelsPtr cpus; - - if (domCaps->virttype =3D=3D VIR_DOMAIN_VIRT_KVM) - cpus =3D qemuCaps->kvmCPUModels; - else - cpus =3D qemuCaps->tcgCPUModels; - - filtered =3D virDomainCapsCPUModelsFilter(cpus, - (const char **)models, - blacklist); - virStringListFree(models); + domCaps->cpu.custom =3D virQEMUCapsGetCPUDefinitions(qemuCaps, + domCaps->vi= rttype, + (const char= **)models, + blacklist); + } else { + domCaps->cpu.custom =3D NULL; } - domCaps->cpu.custom =3D filtered; } =20 return 0; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153756; cv=none; d=zoho.com; s=zohoarc; b=muwmeZ3MT05+MPSq2ZA2EZfdCIrNuHUpHeqfd3mp0EMiaeG/Pvd06svIyPdHyCqACWsN1GhsAOGtwnBjlKUcW14SpLHGlMsHmuWOCVChxY4nBE+ySshzQ05HLQD54zErTwK5gh/A0ihLPQaiu6wXTrXgdkTPW4i/nlraVVIHhVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153756; 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=xUtX3ksicyfY3/T3OWCNQluxMaMMghFRYRuUvW6Prng=; b=RqsjaCK/K1DAKE/66uhWcwhyyrGrEt5r/GDzCBEGjTZ86NK1cQso6+6v05yKLRW9kClDg75qFj8Rm7oCnSBOg/pr0XebdJa3XqNpSObSwyHMCJu6floLFhaJXz66mu22e9WCXfJD0ZB8cAvJi3wfb6HgMUWbgiGI7Q7ONNj3WJs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153756719743.6612113466849; Tue, 15 Oct 2019 08:35:56 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 1C5FD3D3C; Tue, 15 Oct 2019 15:35:55 +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 DE540608C2; Tue, 15 Oct 2019 15:35:54 +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 7A1A86B4B1; Tue, 15 Oct 2019 15:35:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZHHx024693 for ; Tue, 15 Oct 2019 11:35:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0741110027C0; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D066610018F8 for ; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 37056101A86; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:44 +0200 Message-Id: <867e264d67b6563a3d070da2672e0b7090f36c9c.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 08/31] qemu: Use VIR_AUTOPTR in qemuMonitorJSONGetCPUDefinitions 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: , Content-Type: text/plain; charset="utf-8" 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 15 Oct 2019 15:35:55 +0000 (UTC) Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/qemu/qemu_monitor_json.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index d3447dd2f3..418bdcec92 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5527,8 +5527,8 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, qemuMonitorCPUDefInfoPtr **cpus) { int ret =3D -1; - virJSONValuePtr cmd; - virJSONValuePtr reply =3D NULL; + VIR_AUTOPTR(virJSONValue) cmd =3D NULL; + VIR_AUTOPTR(virJSONValue) reply =3D NULL; virJSONValuePtr data; qemuMonitorCPUDefInfoPtr *cpulist =3D NULL; size_t n =3D 0; @@ -5630,8 +5630,6 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, qemuMonitorCPUDefInfoFree(cpulist[i]); VIR_FREE(cpulist); } - virJSONValueFree(cmd); - virJSONValueFree(reply); return ret; } =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153764; cv=none; d=zoho.com; s=zohoarc; b=d3BQhC/KdkwwZcBbZMvP9zkIZsmPSAyTB6ZSVGCgGuaFuBCHKzVmpg9MNi5YpPi0PE6Dk7p7/znC1w5o3P6IKkh2r6H2p8IsLphUAME3+yUQ7iQZZLw62FfpORKsh/OkIgCsrhZpsC6uiZDn0KZjM90Por9T8Yk8sjqjF83SM0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153764; 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=xVAoAsLc25mpRqapTzZ6yvJ17Ne2xqSojHLjF/V9biU=; b=OdNWjmcDRhy8lJ/H3Je6XbCYF4GOA0rMVgrhuTf4mU6YJgmoP9BcKR7UN5+kVOreBokmQrkyL1gc0wIYAVldNWVYkIzUo6xzX8si8bRf9R9Y0+0rtDQygRxeX0QNoZFbLJFs/vjwsSVDCaPSS3VeJeDUL0gElx4OWgSaSI+fEVE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153764330506.6544043128147; Tue, 15 Oct 2019 08:36:04 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 920252108; Tue, 15 Oct 2019 15:36: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 59D2210027C0; Tue, 15 Oct 2019 15:36: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 E5BEE180BA99; Tue, 15 Oct 2019 15:36:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZH2h024715 for ; Tue, 15 Oct 2019 11:35:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 679B95D9E2; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1794D5D9CD for ; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 40513101CD5; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:45 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 09/31] qemu: Change return type of virQEMUCapsFetchCPUDefinitions 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Tue, 15 Oct 2019 15:36:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The function would return a valid virDomainCapsCPUModelsPtr with empty CPU models list if query-cpu-definitions exists in QEMU, but returns GenericError meaning it's not in fact implemented. This behaviour is a bit strange especially after such virDomainCapsCPUModels structure is stored in capabilities XML and parsed back, which will result in NULL virDomainCapsCPUModelsPtr rather than a structure containing nothing. Let's just keep virDomainCapsCPUModelsPtr NULL if the QMP command is not implemented and change the return value to int so that callers can easily check for failure or success. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - new patch src/qemu/qemu_capabilities.c | 34 +++++++++++++++++++++------------- src/qemu/qemu_capabilities.h | 5 +++-- src/qemu/qemu_process.c | 17 ++++++++++------- 3 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b608eb1a43..6fa5e06edb 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2452,17 +2452,26 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemu= Caps, } =20 =20 -virDomainCapsCPUModelsPtr +int virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, - virArch arch) + virArch arch, + virDomainCapsCPUModelsPtr *cpuModels) { virDomainCapsCPUModelsPtr models =3D NULL; qemuMonitorCPUDefInfoPtr *cpus =3D NULL; int ncpus =3D 0; size_t i; + int ret =3D -1; + + *cpuModels =3D NULL; =20 if ((ncpus =3D qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0) - return NULL; + return -1; + + if (ncpus =3D=3D 0) { + ret =3D 0; + goto cleanup; + } =20 /* QEMU 2.11 for Power renamed all CPU models to lower case, we need to * translate them back to libvirt's upper case model names. */ @@ -2471,7 +2480,7 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, char **name; =20 if (virCPUGetModels(arch, &libvirtModels) < 0) - goto error; + goto cleanup; =20 for (name =3D libvirtModels; name && *name; name++) { for (i =3D 0; i < ncpus; i++) { @@ -2480,13 +2489,13 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, =20 VIR_FREE(cpus[i]->name); if (VIR_STRDUP(cpus[i]->name, *name) < 0) - goto error; + goto cleanup; } } } =20 if (!(models =3D virDomainCapsCPUModelsNew(ncpus))) - goto error; + goto cleanup; =20 for (i =3D 0; i < ncpus; i++) { virDomainCapsCPUUsable usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; @@ -2498,19 +2507,18 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, =20 if (virDomainCapsCPUModelsAddSteal(models, &cpus[i]->name, usable, &cpus[i]->blockers) < 0) - goto error; + goto cleanup; } =20 + VIR_STEAL_PTR(*cpuModels, models); + ret =3D 0; + cleanup: for (i =3D 0; i < ncpus; i++) qemuMonitorCPUDefInfoFree(cpus[i]); VIR_FREE(cpus); - return models; - - error: virObjectUnref(models); - models =3D NULL; - goto cleanup; + return ret; } =20 =20 @@ -2524,7 +2532,7 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemu= Caps, if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS)) return 0; =20 - if (!(models =3D virQEMUCapsFetchCPUDefinitions(mon, qemuCaps->arch))) + if (virQEMUCapsFetchCPUDefinitions(mon, qemuCaps->arch, &models) < 0) return -1; =20 if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 67dccc522e..ba3fe3d2b6 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -573,8 +573,9 @@ virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(= virQEMUCapsPtr qemuCaps, virDomainVirtType t= ype, const char **modelW= hitelist, const char **modelB= lacklist); -virDomainCapsCPUModelsPtr virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mo= n, - virArch arch); +int virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, + virArch arch, + virDomainCapsCPUModelsPtr *cpuModels); =20 typedef enum { /* Host CPU definition reported in domain capabilities. */ diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index f37acab9e4..93fe994f8e 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4353,27 +4353,30 @@ qemuProcessUpdateAndVerifyCPU(virQEMUDriverPtr driv= er, } =20 =20 -static virDomainCapsCPUModelsPtr +static int qemuProcessFetchCPUDefinitions(virQEMUDriverPtr driver, virDomainObjPtr vm, - qemuDomainAsyncJob asyncJob) + qemuDomainAsyncJob asyncJob, + virDomainCapsCPUModelsPtr *cpuModels) { qemuDomainObjPrivatePtr priv =3D vm->privateData; virDomainCapsCPUModelsPtr models =3D NULL; + int rc; =20 if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) goto error; =20 - models =3D virQEMUCapsFetchCPUDefinitions(priv->mon, vm->def->os.arch); + rc =3D virQEMUCapsFetchCPUDefinitions(priv->mon, vm->def->os.arch, &mo= dels); =20 - if (qemuDomainObjExitMonitor(driver, vm) < 0) + if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) goto error; =20 - return models; + *cpuModels =3D models; + return 0; =20 error: virObjectUnref(models); - return NULL; + return -1; } =20 =20 @@ -4398,7 +4401,7 @@ qemuProcessUpdateCPU(virQEMUDriverPtr driver, if (qemuProcessUpdateLiveGuestCPU(vm, cpu, disabled) < 0) goto cleanup; =20 - if (!(models =3D qemuProcessFetchCPUDefinitions(driver, vm, asyncJob))= || + if (qemuProcessFetchCPUDefinitions(driver, vm, asyncJob, &models) < 0 = || virCPUTranslate(vm->def->os.arch, vm->def->cpu, models) < 0) goto cleanup; =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153828; cv=none; d=zoho.com; s=zohoarc; b=bOeT9y5YU2z955nlxvL7Kyy5l0A//fZz7EsxsAIhpv16LpzpUjYM2eCaAtOxjG+i8gJ7FHuupXf6MHAJUcL1yKQoRA1MHFsEcG0Hi+y5A+DHMpW5TOicijIT7SqmrcdK/Aqg6cIjOeq7gEdyOWOpRnffwOSAMSuBodZEEx9usbQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153828; 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=TF/BqDyvbtSWyrV1GAKG4NewBZddYdd9DsQmVjBdpSA=; b=htzor3tZ8Vle37RcLjRg/6cQIyxBKrdZXOpgcKYAQvmUMvSLqEzyRQyo9tdtyY2YLqjT3jnuZeTebIOQ0z2Rm9/o9t0/zKQ6bCIMk1NE3Pv9r97Qhx/pSNCznMblh5E+k6ugSq9NrtUZIimE4xfoXUNkgtw+ImRfPlcyai1/dtE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153828713515.1577118230005; Tue, 15 Oct 2019 08:37:08 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 2DC713003194; Tue, 15 Oct 2019 15:37:07 +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 077625888; Tue, 15 Oct 2019 15:37:07 +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 BE1AB249B0; Tue, 15 Oct 2019 15:37:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZFub024638 for ; Tue, 15 Oct 2019 11:35:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1269160C5E; Tue, 15 Oct 2019 15:35:15 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F01560BE2 for ; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 4E54A101CD6; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:46 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 10/31] qemu: Introduce qemuMonitorCPUDefs struct 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 15 Oct 2019 15:37:07 +0000 (UTC) It is a container for a CPU models list (qemuMonitorCPUDefInfo) and a number of elements in this list. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - v1 reviewed by J=C3=A1n Tomko, but the patch had to be changed because of the previous patch src/qemu/qemu_capabilities.c | 30 +++++++++---------- src/qemu/qemu_monitor.c | 39 +++++++++++++++++++------ src/qemu/qemu_monitor.h | 14 +++++++-- src/qemu/qemu_monitor_json.c | 56 ++++++++++++++---------------------- src/qemu/qemu_monitor_json.h | 2 +- tests/qemumonitorjsontest.c | 38 +++++++++--------------- 6 files changed, 93 insertions(+), 86 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 6fa5e06edb..59af3ab6d3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2457,18 +2457,17 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, virArch arch, virDomainCapsCPUModelsPtr *cpuModels) { + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; virDomainCapsCPUModelsPtr models =3D NULL; - qemuMonitorCPUDefInfoPtr *cpus =3D NULL; - int ncpus =3D 0; size_t i; int ret =3D -1; =20 *cpuModels =3D NULL; =20 - if ((ncpus =3D qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0) + if (qemuMonitorGetCPUDefinitions(mon, &defs) < 0) return -1; =20 - if (ncpus =3D=3D 0) { + if (!defs) { ret =3D 0; goto cleanup; } @@ -2483,30 +2482,30 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, goto cleanup; =20 for (name =3D libvirtModels; name && *name; name++) { - for (i =3D 0; i < ncpus; i++) { - if (STRCASENEQ(cpus[i]->name, *name)) + for (i =3D 0; i < defs->ncpus; i++) { + if (STRCASENEQ(defs->cpus[i]->name, *name)) continue; =20 - VIR_FREE(cpus[i]->name); - if (VIR_STRDUP(cpus[i]->name, *name) < 0) + VIR_FREE(defs->cpus[i]->name); + if (VIR_STRDUP(defs->cpus[i]->name, *name) < 0) goto cleanup; } } } =20 - if (!(models =3D virDomainCapsCPUModelsNew(ncpus))) + if (!(models =3D virDomainCapsCPUModelsNew(defs->ncpus))) goto cleanup; =20 - for (i =3D 0; i < ncpus; i++) { + for (i =3D 0; i < defs->ncpus; i++) { virDomainCapsCPUUsable usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; =20 - if (cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_YES) + if (defs->cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_YES) usable =3D VIR_DOMCAPS_CPU_USABLE_YES; - else if (cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_NO) + else if (defs->cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_NO) usable =3D VIR_DOMCAPS_CPU_USABLE_NO; =20 - if (virDomainCapsCPUModelsAddSteal(models, &cpus[i]->name, usable, - &cpus[i]->blockers) < 0) + if (virDomainCapsCPUModelsAddSteal(models, &defs->cpus[i]->name, u= sable, + &defs->cpus[i]->blockers) < 0) goto cleanup; } =20 @@ -2514,9 +2513,6 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, ret =3D 0; =20 cleanup: - for (i =3D 0; i < ncpus; i++) - qemuMonitorCPUDefInfoFree(cpus[i]); - VIR_FREE(cpus); virObjectUnref(models); return ret; } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 49f9159315..d17387d27f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3538,25 +3538,48 @@ qemuMonitorMachineInfoFree(qemuMonitorMachineInfoPt= r machine) =20 int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefInfoPtr **cpus) + qemuMonitorCPUDefsPtr *cpuDefs) { - VIR_DEBUG("cpus=3D%p", cpus); + VIR_DEBUG("cpuDefs=3D%p", cpuDefs); =20 QEMU_CHECK_MONITOR(mon); =20 - return qemuMonitorJSONGetCPUDefinitions(mon, cpus); + return qemuMonitorJSONGetCPUDefinitions(mon, cpuDefs); } =20 =20 void -qemuMonitorCPUDefInfoFree(qemuMonitorCPUDefInfoPtr cpu) +qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs) { - if (!cpu) + size_t i; + + if (!defs) return; =20 - virStringListFree(cpu->blockers); - VIR_FREE(cpu->name); - VIR_FREE(cpu); + for (i =3D 0; i < defs->ncpus; i++) { + virStringListFree(defs->cpus[i]->blockers); + VIR_FREE(defs->cpus[i]->name); + VIR_FREE(defs->cpus[i]); + } + + VIR_FREE(defs->cpus); + VIR_FREE(defs); +} + + +qemuMonitorCPUDefsPtr +qemuMonitorCPUDefsNew(size_t count) +{ + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; + + if (VIR_ALLOC(defs) < 0) + return NULL; + + if (count > 0 && VIR_ALLOC_N(defs->cpus, count) < 0) + return NULL; + + defs->ncpus =3D count; + VIR_RETURN_PTR(defs); } =20 =20 diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 536ba7893b..359bbfca7f 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1101,9 +1101,19 @@ struct _qemuMonitorCPUDefInfo { char **blockers; /* NULL-terminated string list */ }; =20 +typedef struct _qemuMonitorCPUDefs qemuMonitorCPUDefs; +typedef qemuMonitorCPUDefs *qemuMonitorCPUDefsPtr; +struct _qemuMonitorCPUDefs { + size_t ncpus; + qemuMonitorCPUDefInfoPtr *cpus; +}; + int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefInfoPtr **cpus); -void qemuMonitorCPUDefInfoFree(qemuMonitorCPUDefInfoPtr cpu); + qemuMonitorCPUDefsPtr *cpuDefs); +qemuMonitorCPUDefsPtr qemuMonitorCPUDefsNew(size_t count); +void qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs); +VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorCPUDefs, qemuMonitorCPUDefsFree); + =20 typedef enum { QEMU_MONITOR_CPU_PROPERTY_BOOLEAN, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 418bdcec92..664f1b225e 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5524,60 +5524,57 @@ int qemuMonitorJSONGetMachines(qemuMonitorPtr mon, =20 int qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefInfoPtr **cpus) + qemuMonitorCPUDefsPtr *cpuDefs) { - int ret =3D -1; + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; VIR_AUTOPTR(virJSONValue) cmd =3D NULL; VIR_AUTOPTR(virJSONValue) reply =3D NULL; virJSONValuePtr data; - qemuMonitorCPUDefInfoPtr *cpulist =3D NULL; - size_t n =3D 0; + size_t ncpus; size_t i; =20 - *cpus =3D NULL; + *cpuDefs =3D NULL; =20 if (!(cmd =3D qemuMonitorJSONMakeCommand("query-cpu-definitions", NULL= ))) return -1; =20 if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; + return -1; =20 /* Urgh, some QEMU architectures have the query-cpu-definitions * command, but return 'GenericError' with string "Not supported", * instead of simply omitting the command entirely :-( */ - if (qemuMonitorJSONHasError(reply, "GenericError")) { - ret =3D 0; - goto cleanup; - } + if (qemuMonitorJSONHasError(reply, "GenericError")) + return 0; =20 if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_ARRAY) < 0) - goto cleanup; + return -1; =20 data =3D virJSONValueObjectGetArray(reply, "return"); - n =3D virJSONValueArraySize(data); + ncpus =3D virJSONValueArraySize(data); =20 - if (VIR_ALLOC_N(cpulist, n) < 0) - goto cleanup; + if (!(defs =3D qemuMonitorCPUDefsNew(ncpus))) + return -1; =20 - for (i =3D 0; i < n; i++) { + for (i =3D 0; i < defs->ncpus; i++) { virJSONValuePtr child =3D virJSONValueArrayGet(data, i); const char *tmp; qemuMonitorCPUDefInfoPtr cpu; =20 if (VIR_ALLOC(cpu) < 0) - goto cleanup; + return -1; =20 - cpulist[i] =3D cpu; + defs->cpus[i] =3D cpu; =20 if (!(tmp =3D virJSONValueObjectGetString(child, "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("query-cpu-definitions reply data was missing= 'name'")); - goto cleanup; + return -1; } =20 if (VIR_STRDUP(cpu->name, tmp) < 0) - goto cleanup; + return -1; =20 if (virJSONValueObjectHasKey(child, "unavailable-features")) { virJSONValuePtr blockers; @@ -5590,7 +5587,7 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unavailable-features in query-cpu-defini= tions " "reply data was not an array")); - goto cleanup; + return -1; } =20 len =3D virJSONValueArraySize(blockers); @@ -5602,7 +5599,7 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, =20 cpu->usable =3D VIR_TRISTATE_BOOL_NO; if (VIR_ALLOC_N(cpu->blockers, len + 1) < 0) - goto cleanup; + return -1; =20 for (j =3D 0; j < len; j++) { virJSONValuePtr blocker =3D virJSONValueArrayGet(blockers,= j); @@ -5611,26 +5608,17 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unexpected value in unavailable-feat= ures " "array")); - goto cleanup; + return -1; } =20 if (VIR_STRDUP(cpu->blockers[j], virJSONValueGetString(blo= cker)) < 0) - goto cleanup; + return -1; } } } =20 - ret =3D n; - *cpus =3D cpulist; - cpulist =3D NULL; - - cleanup: - if (cpulist) { - for (i =3D 0; i < n; i++) - qemuMonitorCPUDefInfoFree(cpulist[i]); - VIR_FREE(cpulist); - } - return ret; + VIR_STEAL_PTR(*cpuDefs, defs); + return 0; } =20 =20 diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 975de3759a..1b4b3abd72 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -376,7 +376,7 @@ int qemuMonitorJSONGetMachines(qemuMonitorPtr mon, ATTRIBUTE_NONNULL(2); =20 int qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefInfoPtr **cpus) + qemuMonitorCPUDefsPtr *cpuDefs) ATTRIBUTE_NONNULL(2); =20 int qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon, diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 1248db59f2..7b8f63b11e 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -428,10 +428,7 @@ testQemuMonitorJSONGetCPUDefinitions(const void *opaqu= e) { const testGenericData *data =3D opaque; virDomainXMLOptionPtr xmlopt =3D data->xmlopt; - int ret =3D -1; - qemuMonitorCPUDefInfoPtr *cpus =3D NULL; - int ncpus =3D 0; - size_t i; + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; VIR_AUTOPTR(qemuMonitorTest) test =3D NULL; =20 if (!(test =3D qemuMonitorTestNewSchema(xmlopt, data->schema))) @@ -453,31 +450,30 @@ testQemuMonitorJSONGetCPUDefinitions(const void *opaq= ue) " } " " ]" "}") < 0) - goto cleanup; + return -1; =20 - if ((ncpus =3D qemuMonitorGetCPUDefinitions(qemuMonitorTestGetMonitor(= test), - &cpus)) < 0) - goto cleanup; + if (qemuMonitorGetCPUDefinitions(qemuMonitorTestGetMonitor(test), &def= s) < 0) + return -1; =20 - if (ncpus !=3D 3) { + if (defs->ncpus !=3D 3) { virReportError(VIR_ERR_INTERNAL_ERROR, - "ncpus %d is not 3", ncpus); - goto cleanup; + "ncpus %zu is not 3", defs->ncpus); + return -1; } =20 #define CHECK_FULL(i, wantname, Usable) \ do { \ - if (STRNEQ(cpus[i]->name, (wantname))) { \ + if (STRNEQ(defs->cpus[i]->name, (wantname))) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ "name %s is not %s", \ - cpus[i]->name, (wantname)); \ - goto cleanup; \ + defs->cpus[i]->name, (wantname)); \ + return -1; \ } \ - if (cpus[i]->usable !=3D (Usable)) { \ + if (defs->cpus[i]->usable !=3D (Usable)) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ "%s: expecting usable flag %d, got %d", \ - cpus[i]->name, Usable, cpus[i]->usable); \ - goto cleanup; \ + defs->cpus[i]->name, Usable, defs->cpus[i]->usa= ble); \ + return -1; \ } \ } while (0) =20 @@ -496,13 +492,7 @@ testQemuMonitorJSONGetCPUDefinitions(const void *opaqu= e) #undef CHECK_USABLE #undef CHECK_FULL =20 - ret =3D 0; - - cleanup: - for (i =3D 0; i < ncpus; i++) - qemuMonitorCPUDefInfoFree(cpus[i]); - VIR_FREE(cpus); - return ret; + return 0; } =20 =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153784; cv=none; d=zoho.com; s=zohoarc; b=K6SBrZtDOglpTtlBccNUu9Y36TGBDdm6RXIGsHFKpbRw+bFb+qTPO+zWH28ZQho9X+JS5vE9I8Bft5SmBm8eRfDIHOkP+jqslJP6+D9ULMavmEdjbaqvxNByfJXiY6VcVFhIfMIpWwteu9vA+RzsLU7RBxius96m35YXPHuNJNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153784; 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=pzozudQng876imUX/X3kho6Zn+Hzwc3MIKivyu7nG0I=; b=oaDDbrNk7qSm1kz1FLETDYpicszUsIVeVKYy0ujHMRsQ9OOk3uTpgmIsxavrCZQl3hpuFXLrfT0xWLfCEWVhX0F+R10snzYP3GOWYLTjBpOvhdJy/fO/mTHvvazweBHig9mK7OIkgqyLO7kT5cR+TcpWMuX1aMoQFmn8bljEWWU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153784205858.7841459889589; Tue, 15 Oct 2019 08:36:24 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 60CD3C059B7A; Tue, 15 Oct 2019 15:36:22 +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 303594503; Tue, 15 Oct 2019 15:36: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 D26861806B11; Tue, 15 Oct 2019 15:36:21 +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 x9FFZKXL024782 for ; Tue, 15 Oct 2019 11:35:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0A62760127; Tue, 15 Oct 2019 15:35:20 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD0B66012E for ; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 5F78A101CD8; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:47 +0200 Message-Id: <7b2c15650698416362702dbc0b498c6db980ecd9.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 11/31] qemu: Flatten qemuMonitorCPUDefs.cpus 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 15 Oct 2019 15:36:23 +0000 (UTC) Let's store qemuMonitorCPUDefInfo directly in the array of CPUs in qemuMonitorCPUDefs rather then using an array of pointers. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - trivial rebase src/qemu/qemu_capabilities.c | 14 +++++++------- src/qemu/qemu_monitor.c | 5 ++--- src/qemu/qemu_monitor.h | 2 +- src/qemu/qemu_monitor_json.c | 7 +------ tests/qemumonitorjsontest.c | 8 ++++---- 5 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 59af3ab6d3..442445aad9 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2483,11 +2483,11 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, =20 for (name =3D libvirtModels; name && *name; name++) { for (i =3D 0; i < defs->ncpus; i++) { - if (STRCASENEQ(defs->cpus[i]->name, *name)) + if (STRCASENEQ(defs->cpus[i].name, *name)) continue; =20 - VIR_FREE(defs->cpus[i]->name); - if (VIR_STRDUP(defs->cpus[i]->name, *name) < 0) + VIR_FREE(defs->cpus[i].name); + if (VIR_STRDUP(defs->cpus[i].name, *name) < 0) goto cleanup; } } @@ -2499,13 +2499,13 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, for (i =3D 0; i < defs->ncpus; i++) { virDomainCapsCPUUsable usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; =20 - if (defs->cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_YES) + if (defs->cpus[i].usable =3D=3D VIR_TRISTATE_BOOL_YES) usable =3D VIR_DOMCAPS_CPU_USABLE_YES; - else if (defs->cpus[i]->usable =3D=3D VIR_TRISTATE_BOOL_NO) + else if (defs->cpus[i].usable =3D=3D VIR_TRISTATE_BOOL_NO) usable =3D VIR_DOMCAPS_CPU_USABLE_NO; =20 - if (virDomainCapsCPUModelsAddSteal(models, &defs->cpus[i]->name, u= sable, - &defs->cpus[i]->blockers) < 0) + if (virDomainCapsCPUModelsAddSteal(models, &defs->cpus[i].name, us= able, + &defs->cpus[i].blockers) < 0) goto cleanup; } =20 diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index d17387d27f..87a9d06d45 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3557,9 +3557,8 @@ qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs) return; =20 for (i =3D 0; i < defs->ncpus; i++) { - virStringListFree(defs->cpus[i]->blockers); - VIR_FREE(defs->cpus[i]->name); - VIR_FREE(defs->cpus[i]); + virStringListFree(defs->cpus[i].blockers); + VIR_FREE(defs->cpus[i].name); } =20 VIR_FREE(defs->cpus); diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 359bbfca7f..aa2a0e392a 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1105,7 +1105,7 @@ typedef struct _qemuMonitorCPUDefs qemuMonitorCPUDefs; typedef qemuMonitorCPUDefs *qemuMonitorCPUDefsPtr; struct _qemuMonitorCPUDefs { size_t ncpus; - qemuMonitorCPUDefInfoPtr *cpus; + qemuMonitorCPUDefInfoPtr cpus; }; =20 int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 664f1b225e..de75c46dc1 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5560,12 +5560,7 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, for (i =3D 0; i < defs->ncpus; i++) { virJSONValuePtr child =3D virJSONValueArrayGet(data, i); const char *tmp; - qemuMonitorCPUDefInfoPtr cpu; - - if (VIR_ALLOC(cpu) < 0) - return -1; - - defs->cpus[i] =3D cpu; + qemuMonitorCPUDefInfoPtr cpu =3D defs->cpus + i; =20 if (!(tmp =3D virJSONValueObjectGetString(child, "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 7b8f63b11e..18ccf271f5 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -463,16 +463,16 @@ testQemuMonitorJSONGetCPUDefinitions(const void *opaq= ue) =20 #define CHECK_FULL(i, wantname, Usable) \ do { \ - if (STRNEQ(defs->cpus[i]->name, (wantname))) { \ + if (STRNEQ(defs->cpus[i].name, (wantname))) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ "name %s is not %s", \ - defs->cpus[i]->name, (wantname)); \ + defs->cpus[i].name, (wantname)); \ return -1; \ } \ - if (defs->cpus[i]->usable !=3D (Usable)) { \ + if (defs->cpus[i].usable !=3D (Usable)) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ "%s: expecting usable flag %d, got %d", \ - defs->cpus[i]->name, Usable, defs->cpus[i]->usa= ble); \ + defs->cpus[i].name, Usable, defs->cpus[i].usabl= e); \ return -1; \ } \ } while (0) --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153748; cv=none; d=zoho.com; s=zohoarc; b=OWzzKcnKQuOzxZyY6vFLGGY6ihzWUEcwSgjeGlngY4lcQC9pstQBENMXSnvjOjQLMsvwaa+xYaeJH4D5tKLJv5XrXnasKbHjz1EGCCFHPHboOSASBCvS3DSuoZS0Tv2+zPZV4oxSp9Be5Fd54J+dCI+vvblElFpQ1VAU3SSTXoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153748; 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=UiwRPaXEp/ApPQVxeEQ6IpwKps6qcv+ak7Jw+oCAyaY=; b=atpY25pAnRP0cLuTowS4fqTEIg8yzQZNcqo1sUjezMSna8PcpwJtDcVr6lLUN3CX78kXg/l1g123GPr626IqAALtphtvnduK8H1sNENdxcSz19qMr3iDQMB4VMi4t/IxA05V0Yd6E7QEpI+frk2nw1f7atILEHIOG1XUYr5H79g= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153748470269.6353423741683; Tue, 15 Oct 2019 08:35:48 -0700 (PDT) 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 025422CE90A; Tue, 15 Oct 2019 15:35:47 +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 CF58D5D712; Tue, 15 Oct 2019 15:35:46 +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 8D1AF180BA9E; Tue, 15 Oct 2019 15:35:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZGGw024652 for ; Tue, 15 Oct 2019 11:35:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CB423CC8; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20F2919C5B for ; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 65487101CD7; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:48 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 12/31] build: Export virStringListCopy internal API 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: , 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.29]); Tue, 15 Oct 2019 15:35:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/libvirt_private.syms | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 7d62df8086..1af18b880b 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -3077,6 +3077,7 @@ virStringIsEmpty; virStringIsPrintable; virStringListAdd; virStringListAutoFree; +virStringListCopy; virStringListFree; virStringListFreeCount; virStringListGetFirstWithPrefix; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153761; cv=none; d=zoho.com; s=zohoarc; b=W+yYTEo479uhhSfDFdIrhi3ziIfDcwY8TwQNxeF0PVvrzkLLMa7LjxPGwq7u4kro3JuoxI6mFeW5Vx3yIAd5Er9foHt5y2SApFngiahDDGmk9hnqEI/n2Lwcyyk9dag95NyL9D9L3nXNO6iqlWINqoyKrMPsIISq4BW/RNbpVDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153761; 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=ZUkBktQ30dFXYZ1WZgGTujj6vGwZs9l4Z+wwcne3too=; b=ShX68P3xGv4KAfX6sxWQL0itwDc2RxSv7KOti/aLK4r0iRFc+4PuEMpiQn25zmu5KICYwTgbGr1I2pKPnuu3A8G7qJge1OrDzdKgs75OmEoLKEBWuDYLuKAVOKrsX3AQTy6Ck2PWoccyhPO+J4pSx2KXMHgW8yiAREfK0VLPy7Y= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15711537611797.31766853247575; Tue, 15 Oct 2019 08:36:01 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 704C610C0928; Tue, 15 Oct 2019 15:35:59 +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 4057410027C0; Tue, 15 Oct 2019 15:35:59 +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 DE8F36EF43; Tue, 15 Oct 2019 15:35:58 +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 x9FFZHsS024701 for ; Tue, 15 Oct 2019 11:35:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 34596608C2; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09962608A5 for ; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 6CD15101CDA; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:49 +0200 Message-Id: <26ba0ed1dde233d169d31ccf00c82ddc07f0647c.1571152057.git.jdenemar@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 Subject: [libvirt] [PATCH v2 13/31] qemu: Add qemuMonitorCPUDefsCopy 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Tue, 15 Oct 2019 15:36:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/qemu/qemu_monitor.c | 33 +++++++++++++++++++++++++++++++++ src/qemu/qemu_monitor.h | 2 ++ 2 files changed, 35 insertions(+) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 87a9d06d45..8d86112f30 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3582,6 +3582,39 @@ qemuMonitorCPUDefsNew(size_t count) } =20 =20 +int +qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr *dst, + qemuMonitorCPUDefsPtr src) +{ + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; + size_t i; + + if (!src) { + *dst =3D NULL; + return 0; + } + + if (!(defs =3D qemuMonitorCPUDefsNew(src->ncpus))) + return -1; + + defs->ncpus =3D src->ncpus; + for (i =3D 0; i < src->ncpus; i++) { + qemuMonitorCPUDefInfoPtr cpuDst =3D defs->cpus + i; + qemuMonitorCPUDefInfoPtr cpuSrc =3D src->cpus + i; + + cpuDst->usable =3D cpuSrc->usable; + + if (VIR_STRDUP(cpuDst->name, cpuSrc->name) < 0 || + virStringListCopy(&cpuDst->blockers, + (const char **)cpuSrc->blockers) < 0) + return -1; + } + + VIR_STEAL_PTR(*dst, defs); + return 0; +} + + int qemuMonitorGetCPUModelExpansion(qemuMonitorPtr mon, qemuMonitorCPUModelExpansionType type, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index aa2a0e392a..4f355c760a 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1111,6 +1111,8 @@ struct _qemuMonitorCPUDefs { int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, qemuMonitorCPUDefsPtr *cpuDefs); qemuMonitorCPUDefsPtr qemuMonitorCPUDefsNew(size_t count); +int qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr *dst, + qemuMonitorCPUDefsPtr src); void qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs); VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorCPUDefs, qemuMonitorCPUDefsFree); =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153835; cv=none; d=zoho.com; s=zohoarc; b=nbCuF0ykZmnevFT3CmWXKBs1aNJJTry/Vag08EALHmkK/yrS3u0A5ncoUziJAylXgf8FJrX6WmQhluajQtz2Y+JaEHqgRZRahxBUPOOG5m5hW3A57jotodM6wUui6bC0SCfVUAEYDKcak7qeKMAVpjKzETWCVgpoHkSOxPAzZPc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153835; 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=JQTjWSITawLxTR0LtFRtM8wz8Ewr1zOEaKb2r0fZUcY=; b=nJSvZm839W4zLcLi9tdy6kLv1uCAVaBH9LboBMdCedS4ePGTNvpqCJE+yv3lP7Nb1lmVHaQpTa9sUJN04KGzgjEZ2g9GdwD+0fjPTNZM1Gex9zm3whxqMayJejQmTCFYlbid0M+otHB21dwtngU2hYGAsrWlDB6LnUegSYh2QZY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153835783478.78671422593106; Tue, 15 Oct 2019 08:37:15 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 2A1CEC0546FB; Tue, 15 Oct 2019 15:37:14 +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 EAC2B60625; Tue, 15 Oct 2019 15:37:13 +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 98F2C180BA9B; Tue, 15 Oct 2019 15:37:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZH8T024700 for ; Tue, 15 Oct 2019 11:35:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2C7F110018F8; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0E2410027AB for ; Tue, 15 Oct 2019 15:35:14 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 730C7101CDB; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:50 +0200 Message-Id: <0865caa02fb78605a6819e9fccdf1e9fc3aa9e9d.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 14/31] qemu: Use VIR_AUTOFREE in virQEMUCapsLoadCPUModels 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: , Content-Type: text/plain; charset="utf-8" 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 15 Oct 2019 15:37:14 +0000 (UTC) Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/qemu/qemu_capabilities.c | 58 +++++++++++++++--------------------- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 442445aad9..e38ad03ab5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3474,15 +3474,10 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, virDomainVirtType type) { virDomainCapsCPUModelsPtr cpus =3D NULL; - xmlNodePtr *nodes =3D NULL; - char *str =3D NULL; + VIR_AUTOFREE(xmlNodePtr *) nodes =3D NULL; size_t i; int n; - int ret =3D -1; xmlNodePtr node; - xmlNodePtr *blockerNodes =3D NULL; - char **blockers =3D NULL; - int nblockers; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) n =3D virXPathNodeSet("./cpu[@type=3D'kvm']", ctxt, &nodes); @@ -3492,16 +3487,14 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, if (n < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("failed to parse qemu capabilities cpus")); - goto cleanup; + return -1; } =20 - if (n =3D=3D 0) { - ret =3D 0; - goto cleanup; - } + if (n =3D=3D 0) + return 0; =20 if (!(cpus =3D virDomainCapsCPUModelsNew(n))) - goto cleanup; + return -1; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) qemuCaps->kvmCPUModels =3D cpus; @@ -3510,19 +3503,24 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, =20 for (i =3D 0; i < n; i++) { int usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; - - if ((str =3D virXMLPropString(nodes[i], "usable")) && - (usable =3D virDomainCapsCPUUsableTypeFromString(str)) < 0) { + VIR_AUTOFREE(char *) strUsable =3D NULL; + VIR_AUTOFREE(char *) name =3D NULL; + VIR_AUTOFREE(xmlNodePtr *) blockerNodes =3D NULL; + VIR_AUTOSTRINGLIST blockers =3D NULL; + int nblockers; + + if ((strUsable =3D virXMLPropString(nodes[i], "usable")) && + (usable =3D virDomainCapsCPUUsableTypeFromString(strUsable)) <= 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown value '%s' in attribute 'usable'"), = str); - goto cleanup; + _("unknown value '%s' in attribute 'usable'"), + strUsable); + return -1; } - VIR_FREE(str); =20 - if (!(str =3D virXMLPropString(nodes[i], "name"))) { + if (!(name =3D virXMLPropString(nodes[i], "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing cpu name in QEMU capabilities cache"= )); - goto cleanup; + return -1; } =20 node =3D ctxt->node; @@ -3533,38 +3531,30 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, if (nblockers < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("failed to parse CPU blockers in QEMU capabil= ities")); - goto cleanup; + return -1; } =20 if (nblockers > 0) { size_t j; =20 if (VIR_ALLOC_N(blockers, nblockers + 1) < 0) - goto cleanup; + return -1; =20 for (j =3D 0; j < nblockers; j++) { if (!(blockers[j] =3D virXMLPropString(blockerNodes[j], "n= ame"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing blocker name in QEMU " "capabilities cache")); - goto cleanup; + return -1; } } - VIR_FREE(blockerNodes); } =20 - if (virDomainCapsCPUModelsAddSteal(cpus, &str, usable, &blockers) = < 0) - goto cleanup; + if (virDomainCapsCPUModelsAddSteal(cpus, &name, usable, &blockers)= < 0) + return -1; } =20 - ret =3D 0; - - cleanup: - VIR_FREE(nodes); - VIR_FREE(str); - VIR_FREE(blockerNodes); - virStringListFree(blockers); - return ret; + return 0; } =20 =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153832; cv=none; d=zoho.com; s=zohoarc; b=nlhpnnHZZ6Ok3EuXyqKo/zdZeUT8ANYN5qr2h7g3bMqIaAa7r50o+O/pdOiieMAwoTYSg9GQs8SqNmtT9s1pCYiZ3lKpLiEyLtg6e9sGiJ500HAu0fpqrudRQS60hdP3jm9p3xoBwxJlWNdMjVbcR65Yok0l/0Rq3oyswEkl1Z4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153832; 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=ReujcpnB8IkKThUBkBzNQl35RiHsAwfNH/UPIJ4zYA0=; b=Y/nzFhN6YqzD+9cnDcxVN7J3mlI0WuntwTyRhsPXBVOs8UEPoH46JWo18oQ8b1DGXkfJuvbDJC94GKI9HV4DuoXz+o13NL/iBFAG8iO9AWJ07Mki4vJzhY+8wMUMsyOi7rnUEWlup/xcNZsKlK2sbyNHizdHUOuSiiOQyYkMV8o= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153832604967.9926480662208; Tue, 15 Oct 2019 08:37:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A270D3086E21; Tue, 15 Oct 2019 15:37: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 7685160C57; Tue, 15 Oct 2019 15:37: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 3300A244FB; Tue, 15 Oct 2019 15:37:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZGBf024655 for ; Tue, 15 Oct 2019 11:35:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 549BA60C5E; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29E0D60BE2 for ; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 79354101CDC; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:51 +0200 Message-Id: <5739e8eba52933c1acb85d9ea28966ca25ca4207.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 15/31] qemu: Introduce virQEMUCapsCPUDefsToModels 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: , 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 15 Oct 2019 15:37:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The function translates qemuMonitorCPUDefsPtr (used by QEMU caps probing code) into virDomainCapsCPUModelsPtr used by domain capabilities. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - trivial rebase src/qemu/qemu_capabilities.c | 71 +++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e38ad03ab5..87ac9bacdc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1887,6 +1887,41 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, } =20 =20 +static virDomainCapsCPUModelsPtr +virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs, + const char **modelWhitelist, + const char **modelBlacklist) +{ + VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels =3D NULL; + size_t i; + + if (!(cpuModels =3D virDomainCapsCPUModelsNew(defs->ncpus))) + return NULL; + + for (i =3D 0; i < defs->ncpus; i++) { + qemuMonitorCPUDefInfoPtr cpu =3D defs->cpus + i; + virDomainCapsCPUUsable usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; + + if (modelWhitelist && !virStringListHasString(modelWhitelist, cpu-= >name)) + continue; + + if (modelBlacklist && virStringListHasString(modelBlacklist, cpu->= name)) + continue; + + if (cpu->usable =3D=3D VIR_TRISTATE_BOOL_YES) + usable =3D VIR_DOMCAPS_CPU_USABLE_YES; + else if (cpu->usable =3D=3D VIR_TRISTATE_BOOL_NO) + usable =3D VIR_DOMCAPS_CPU_USABLE_NO; + + if (virDomainCapsCPUModelsAdd(cpuModels, cpu->name, + usable, cpu->blockers) < 0) + return NULL; + } + + VIR_RETURN_PTR(cpuModels); +} + + virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, virDomainVirtType type, @@ -2458,19 +2493,15 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, virDomainCapsCPUModelsPtr *cpuModels) { VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; - virDomainCapsCPUModelsPtr models =3D NULL; size_t i; - int ret =3D -1; =20 *cpuModels =3D NULL; =20 if (qemuMonitorGetCPUDefinitions(mon, &defs) < 0) return -1; =20 - if (!defs) { - ret =3D 0; - goto cleanup; - } + if (!defs) + return 0; =20 /* QEMU 2.11 for Power renamed all CPU models to lower case, we need to * translate them back to libvirt's upper case model names. */ @@ -2479,7 +2510,7 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, char **name; =20 if (virCPUGetModels(arch, &libvirtModels) < 0) - goto cleanup; + return -1; =20 for (name =3D libvirtModels; name && *name; name++) { for (i =3D 0; i < defs->ncpus; i++) { @@ -2488,33 +2519,15 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, =20 VIR_FREE(defs->cpus[i].name); if (VIR_STRDUP(defs->cpus[i].name, *name) < 0) - goto cleanup; + return -1; } } } =20 - if (!(models =3D virDomainCapsCPUModelsNew(defs->ncpus))) - goto cleanup; - - for (i =3D 0; i < defs->ncpus; i++) { - virDomainCapsCPUUsable usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; - - if (defs->cpus[i].usable =3D=3D VIR_TRISTATE_BOOL_YES) - usable =3D VIR_DOMCAPS_CPU_USABLE_YES; - else if (defs->cpus[i].usable =3D=3D VIR_TRISTATE_BOOL_NO) - usable =3D VIR_DOMCAPS_CPU_USABLE_NO; - - if (virDomainCapsCPUModelsAddSteal(models, &defs->cpus[i].name, us= able, - &defs->cpus[i].blockers) < 0) - goto cleanup; - } - - VIR_STEAL_PTR(*cpuModels, models); - ret =3D 0; + if (!(*cpuModels =3D virQEMUCapsCPUDefsToModels(defs, NULL, NULL))) + return -1; =20 - cleanup: - virObjectUnref(models); - return ret; + return 0; } =20 =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153743; cv=none; d=zoho.com; s=zohoarc; b=SMENnLFV8bEigWGfduwl5PVZZ0lvLe0aZ9BocYu7rGf+BtwpqsH5rKNvCGICNyQnQJzp44lrddPqGoWp9vFPu3Vh2JVSZ2zbmqT4NeboHQBqIRG1qtaY7r+UN6gInicrIU2YhwCX1GCQCx5QSAdb9hagFEKraOioEHa5SMxGUXo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153743; 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=mWb3b3N013YH0f5GDqM+XXRpOPywlNX13z83yeKPSts=; b=g1LuoDLK3z5s5HgvJ3YRB8l4AifTxvdZ+ae7AluO08mayiqOOigbNecoVyqmFLQUTGpmE6ML7Sn0pIbLCiS2fCN+6x8wWHH+91eXMB7BFHWXR317RRBKh2fJ6lyNDNIKaRB/N+TSXtO0oCojeC4vK3RMdk13ZsUrV1gLu+2RAso= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153743553812.2935806261663; Tue, 15 Oct 2019 08:35:43 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id ECBC9302C07C; Tue, 15 Oct 2019 15:35:41 +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 C070D10027C0; Tue, 15 Oct 2019 15:35:41 +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 80F1162CF7; Tue, 15 Oct 2019 15:35:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZG8e024670 for ; Tue, 15 Oct 2019 11:35:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7CBF53DAD; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C2C719C58 for ; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 7F5C6101CDD; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:52 +0200 Message-Id: <5e67e005879758fa53ebb8a6be075074c6c0e824.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 16/31] qemu: Rename virQEMUCaps{Get, Fetch}CPUDefinitions 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 15 Oct 2019 15:35:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The functions return virDomainCapsCPUModelsPtr and thus they should be called *CPUModels for consistency. Functions called *CPUDefinitions will work on qemuMonitorCPUDefsPtr. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - new patch src/qemu/qemu_capabilities.c | 28 ++++++++++++++-------------- src/qemu/qemu_capabilities.h | 14 +++++++------- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_process.c | 4 ++-- tests/cputest.c | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 87ac9bacdc..cdc3a2d4b0 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1923,10 +1923,10 @@ virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr de= fs, =20 =20 virDomainCapsCPUModelsPtr -virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps, - virDomainVirtType type, - const char **modelWhitelist, - const char **modelBlacklist) +virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps, + virDomainVirtType type, + const char **modelWhitelist, + const char **modelBlacklist) { virDomainCapsCPUModelsPtr cpuModels; =20 @@ -2488,9 +2488,9 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemuCa= ps, =20 =20 int -virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, - virArch arch, - virDomainCapsCPUModelsPtr *cpuModels) +virQEMUCapsFetchCPUModels(qemuMonitorPtr mon, + virArch arch, + virDomainCapsCPUModelsPtr *cpuModels) { VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; size_t i; @@ -2541,7 +2541,7 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemu= Caps, if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS)) return 0; =20 - if (virQEMUCapsFetchCPUDefinitions(mon, qemuCaps->arch, &models) < 0) + if (virQEMUCapsFetchCPUModels(mon, qemuCaps->arch, &models) < 0) return -1; =20 if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) @@ -3164,7 +3164,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, if (!(data =3D virQEMUCapsGetCPUModelX86Data(qemuCaps, model, migratab= le))) goto cleanup; =20 - cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type, NULL, NULL); + cpuModels =3D virQEMUCapsGetCPUModels(qemuCaps, type, NULL, NULL); =20 if (cpuDecode(cpu, data, cpuModels) < 0) goto cleanup; @@ -3253,7 +3253,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, =20 VIR_DEBUG("No host CPU model info from QEMU; probing host CPU dire= ctly"); =20 - cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, type, NULL, N= ULL); + cpuModels =3D virQEMUCapsGetCPUModels(qemuCaps, type, NULL, NULL); hostCPU =3D virQEMUCapsProbeHostCPU(hostArch, cpuModels); =20 if (!hostCPU || @@ -5308,10 +5308,10 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps, VIR_AUTOSTRINGLIST models =3D NULL; =20 if (virCPUGetModels(domCaps->arch, &models) >=3D 0) { - domCaps->cpu.custom =3D virQEMUCapsGetCPUDefinitions(qemuCaps, - domCaps->vi= rttype, - (const char= **)models, - blacklist); + domCaps->cpu.custom =3D virQEMUCapsGetCPUModels(qemuCaps, + domCaps->virttyp= e, + (const char **)m= odels, + blacklist); } else { domCaps->cpu.custom =3D NULL; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index ba3fe3d2b6..923706c3bf 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -569,13 +569,13 @@ int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuC= aps, const char **name, size_t count, virDomainCapsCPUUsable usable); -virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemu= Caps, - virDomainVirtType t= ype, - const char **modelW= hitelist, - const char **modelB= lacklist); -int virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, - virArch arch, - virDomainCapsCPUModelsPtr *cpuModels); +virDomainCapsCPUModelsPtr virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps, + virDomainVirtType type, + const char **modelWhitel= ist, + const char **modelBlackl= ist); +int virQEMUCapsFetchCPUModels(qemuMonitorPtr mon, + virArch arch, + virDomainCapsCPUModelsPtr *cpuModels); =20 typedef enum { /* Host CPU definition reported in domain capabilities. */ diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 802f07fe92..50c07f38ad 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13939,7 +13939,7 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn, if (!qemuCaps) goto cleanup; =20 - if (!(cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, virttype, N= ULL, NULL)) || + if (!(cpuModels =3D virQEMUCapsGetCPUModels(qemuCaps, virttype, NULL, = NULL)) || cpuModels->nmodels =3D=3D 0) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("QEMU '%s' does not support any CPU models for " diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 93fe994f8e..d1c4035c1c 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4366,7 +4366,7 @@ qemuProcessFetchCPUDefinitions(virQEMUDriverPtr drive= r, if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) goto error; =20 - rc =3D virQEMUCapsFetchCPUDefinitions(priv->mon, vm->def->os.arch, &mo= dels); + rc =3D virQEMUCapsFetchCPUModels(priv->mon, vm->def->os.arch, &models); =20 if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0) goto error; @@ -6139,7 +6139,7 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, VIR_QEMU_CAPS_HOST_CPU_MI= GRATABLE)) < 0) return -1; =20 - cpuModels =3D virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType= , NULL, NULL); + cpuModels =3D virQEMUCapsGetCPUModels(qemuCaps, def->virtType, NUL= L, NULL); =20 if (virCPUTranslate(def->os.arch, def->cpu, cpuModels) < 0) return -1; diff --git a/tests/cputest.c b/tests/cputest.c index 4428d451cf..727e603ed7 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -550,7 +550,7 @@ cpuTestGetCPUModels(const struct data *data, if (!(qemuCaps =3D cpuTestMakeQEMUCaps(data))) return -1; =20 - *models =3D virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM= , NULL, NULL); + *models =3D virQEMUCapsGetCPUModels(qemuCaps, VIR_DOMAIN_VIRT_KVM, NUL= L, NULL); =20 virObjectUnref(qemuCaps); =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153752; cv=none; d=zoho.com; s=zohoarc; b=hRNKnwVX3br4g64JbdH5cD5xPPr51sJrjLiEYulmbBIleixJ/COygF9XwPX5yqPmampgtgg6GV1G4EVykvDDjlWpOaw0p2bptGQtH4EyhY2wJb9m60rLvcGpl7zZJB9jyA2Vjq+YEpR08aRIpOzKhfSSaafuWJDuzWIbM8YdflI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153752; 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=1gLq0CbqK2dgaPtk2GAOPADZnTPITeGTFKPeTfZa+n4=; b=Ng5TRHhlAqIMecTT7H6esn0Sk6PQq4byFM3G5nDlaRo9utCNAjDP8D/6b7ScEuEMQaSgYpit0LBbSjYtOc5lzwTrTDnTgrsJ7V3C3ttBVE6R1MR4m/AnTDaSQPf/jJAkvxSdMAc4iE2KBkWKDsbwh6gZen49KZZvMUFtJpFuh/o= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153752806981.2351314017354; Tue, 15 Oct 2019 08:35:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC796C065121; Tue, 15 Oct 2019 15:35:50 +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 C4C9B5C1D4; Tue, 15 Oct 2019 15:35:50 +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 72FA66B49D; Tue, 15 Oct 2019 15:35:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZGQ0024659 for ; Tue, 15 Oct 2019 11:35:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5794A19C5B; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2CFE9194BB for ; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 857D7101CDE; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:53 +0200 Message-Id: <20b93ba7e696423bbc84bef40d7dbdfc4eca68ad.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 17/31] qemu: Split virQEMUCapsFetchCPUModels 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: , 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 15 Oct 2019 15:35:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Most of the code moved to a new virQEMUCapsFetchCPUDefinitions function and the existing virQEMUCapsFetchCPUModels just becomes a small wrapper around virQEMUCapsFetchCPUDefinitions and virQEMUCapsCPUDefsToModels. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - new patch src/qemu/qemu_capabilities.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index cdc3a2d4b0..436d65f578 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2487,15 +2487,15 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemu= Caps, } =20 =20 -int -virQEMUCapsFetchCPUModels(qemuMonitorPtr mon, - virArch arch, - virDomainCapsCPUModelsPtr *cpuModels) +static int +virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, + virArch arch, + qemuMonitorCPUDefsPtr *cpuDefs) { VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; size_t i; =20 - *cpuModels =3D NULL; + *cpuDefs =3D NULL; =20 if (qemuMonitorGetCPUDefinitions(mon, &defs) < 0) return -1; @@ -2524,7 +2524,24 @@ virQEMUCapsFetchCPUModels(qemuMonitorPtr mon, } } =20 - if (!(*cpuModels =3D virQEMUCapsCPUDefsToModels(defs, NULL, NULL))) + VIR_STEAL_PTR(*cpuDefs, defs); + return 0; +} + + +int +virQEMUCapsFetchCPUModels(qemuMonitorPtr mon, + virArch arch, + virDomainCapsCPUModelsPtr *cpuModels) +{ + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; + + *cpuModels =3D NULL; + + if (virQEMUCapsFetchCPUDefinitions(mon, arch, &defs) < 0) + return -1; + + if (defs && !(*cpuModels =3D virQEMUCapsCPUDefsToModels(defs, NULL, NU= LL))) return -1; =20 return 0; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153747; cv=none; d=zoho.com; s=zohoarc; b=YsnpI/tV5giaUIyqTyL5Pe6oh/cix7hbcDChpF+PlhUjzqzvwv66naUaawioNDFpXejGOvD6riYY3J0uKuRehLu4zCyQHuPro1xv4hrmy05riKAW8XUu5IPjKUBTO8rI1kbtq0IR55cXJsy0LzL9A60d9sOj/V0rdgYKtbswrYw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153747; 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=voM6eldG96CI0cNOS5Wl87BhkXw8/WYD9l0kW7fly7M=; b=BteDPILQLgEaNvRJcmVZQFqN+9AIwAepRpqkahxTytKhD90E7E68TGhtHY96eVNBkBl+6LwJbxgoAlO3SoU3oJ8xU/8MwAb1veLMRRRjy9ffGisYjMnMGegzxePu79hfG0sDE1b4Db7AjgdR4tAVPM4piL/RZd+ABc9VUuB3VBQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153747891787.9640683810098; Tue, 15 Oct 2019 08:35:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C9ED2300D1C8; Tue, 15 Oct 2019 15:35:45 +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 9B52E60BE2; Tue, 15 Oct 2019 15:35:45 +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 50253180BA9A; Tue, 15 Oct 2019 15:35:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZG8E024671 for ; Tue, 15 Oct 2019 11:35:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 81D1C60BE2; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 308CE60C57 for ; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 8BF39101CDF; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:54 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 18/31] qemu: Switch qemuCaps to use qemuMonitorCPUDefs 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: , 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 15 Oct 2019 15:35:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We will need to keep some QEMU-specific data for each CPU model supported by a QEMU binary. Instead of complicating the generic virDomainCapsCPUModelsPtr, we can just directly store qemuMonitorCPUDefsPtr returned by the capabilities probing code. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - adapted to changes made by the new patches src/qemu/qemu_capabilities.c | 109 +++++++++++++++++------------------ 1 file changed, 53 insertions(+), 56 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 436d65f578..a274cef120 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -607,8 +607,8 @@ struct _virQEMUCaps { virArch arch; =20 virHashTablePtr domCapsCache; - virDomainCapsCPUModelsPtr kvmCPUModels; - virDomainCapsCPUModelsPtr tcgCPUModels; + qemuMonitorCPUDefsPtr kvmCPUModels; + qemuMonitorCPUDefsPtr tcgCPUModels; =20 size_t nmachineTypes; struct virQEMUCapsMachineType *machineTypes; @@ -1625,17 +1625,9 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qem= uCaps) =20 ret->arch =3D qemuCaps->arch; =20 - if (qemuCaps->kvmCPUModels) { - ret->kvmCPUModels =3D virDomainCapsCPUModelsCopy(qemuCaps->kvmCPUM= odels); - if (!ret->kvmCPUModels) - goto error; - } - - if (qemuCaps->tcgCPUModels) { - ret->tcgCPUModels =3D virDomainCapsCPUModelsCopy(qemuCaps->tcgCPUM= odels); - if (!ret->tcgCPUModels) - goto error; - } + if (qemuMonitorCPUDefsCopy(&ret->kvmCPUModels, qemuCaps->kvmCPUModels)= < 0 || + qemuMonitorCPUDefsCopy(&ret->tcgCPUModels, qemuCaps->tcgCPUModels)= < 0) + goto error; =20 if (virQEMUCapsHostCPUDataCopy(&ret->kvmCPU, &qemuCaps->kvmCPU) < 0 || virQEMUCapsHostCPUDataCopy(&ret->tcgCPU, &qemuCaps->tcgCPU) < 0) @@ -1861,25 +1853,36 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCap= s, virDomainCapsCPUUsable usable) { size_t i; - virDomainCapsCPUModelsPtr cpus =3D NULL; + size_t start; + qemuMonitorCPUDefsPtr defs =3D NULL; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM && qemuCaps->kvmCPUModels) - cpus =3D qemuCaps->kvmCPUModels; + defs =3D qemuCaps->kvmCPUModels; else if (type =3D=3D VIR_DOMAIN_VIRT_QEMU && qemuCaps->tcgCPUModels) - cpus =3D qemuCaps->tcgCPUModels; + defs =3D qemuCaps->tcgCPUModels; + + if (defs) { + start =3D defs->ncpus; =20 - if (!cpus) { - if (!(cpus =3D virDomainCapsCPUModelsNew(count))) + if (VIR_EXPAND_N(defs->cpus, defs->ncpus, count) < 0) + return -1; + } else { + start =3D 0; + + if (!(defs =3D qemuMonitorCPUDefsNew(count))) return -1; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - qemuCaps->kvmCPUModels =3D cpus; + qemuCaps->kvmCPUModels =3D defs; else - qemuCaps->tcgCPUModels =3D cpus; + qemuCaps->tcgCPUModels =3D defs; } =20 for (i =3D 0; i < count; i++) { - if (virDomainCapsCPUModelsAdd(cpus, name[i], usable, NULL) < 0) + qemuMonitorCPUDefInfoPtr cpu =3D defs->cpus + start + i; + + cpu->usable =3D usable; + if (VIR_STRDUP(cpu->name, name[i]) < 0) return -1; } =20 @@ -1928,20 +1931,17 @@ virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps, const char **modelWhitelist, const char **modelBlacklist) { - virDomainCapsCPUModelsPtr cpuModels; + qemuMonitorCPUDefsPtr defs; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - cpuModels =3D qemuCaps->kvmCPUModels; + defs =3D qemuCaps->kvmCPUModels; else - cpuModels =3D qemuCaps->tcgCPUModels; + defs =3D qemuCaps->tcgCPUModels; =20 - if (!cpuModels) + if (!defs) return NULL; =20 - if (modelWhitelist || modelBlacklist) - return virDomainCapsCPUModelsFilter(cpuModels, modelWhitelist, mod= elBlacklist); - - return virDomainCapsCPUModelsCopy(cpuModels); + return virQEMUCapsCPUDefsToModels(defs, modelWhitelist, modelBlacklist= ); } =20 =20 @@ -2001,7 +2001,7 @@ virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, virDomainVirtType type, virCPUMode mode) { - virDomainCapsCPUModelsPtr cpus; + qemuMonitorCPUDefsPtr cpus; =20 switch (mode) { case VIR_CPU_MODE_HOST_PASSTHROUGH: @@ -2017,7 +2017,7 @@ virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, cpus =3D qemuCaps->kvmCPUModels; else cpus =3D qemuCaps->tcgCPUModels; - return cpus && cpus->nmodels > 0; + return cpus && cpus->ncpus > 0; =20 case VIR_CPU_MODE_LAST: break; @@ -2553,18 +2553,18 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qe= muCaps, qemuMonitorPtr mon, bool tcg) { - virDomainCapsCPUModelsPtr models =3D NULL; + qemuMonitorCPUDefsPtr defs =3D NULL; =20 if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS)) return 0; =20 - if (virQEMUCapsFetchCPUModels(mon, qemuCaps->arch, &models) < 0) + if (virQEMUCapsFetchCPUDefinitions(mon, qemuCaps->arch, &defs) < 0) return -1; =20 if (tcg || !virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) - qemuCaps->tcgCPUModels =3D models; + qemuCaps->tcgCPUModels =3D defs; else - qemuCaps->kvmCPUModels =3D models; + qemuCaps->kvmCPUModels =3D defs; =20 return 0; } @@ -3503,7 +3503,7 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, xmlXPathContextPtr ctxt, virDomainVirtType type) { - virDomainCapsCPUModelsPtr cpus =3D NULL; + VIR_AUTOPTR(qemuMonitorCPUDefs) defs =3D NULL; VIR_AUTOFREE(xmlNodePtr *) nodes =3D NULL; size_t i; int n; @@ -3523,20 +3523,14 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, if (n =3D=3D 0) return 0; =20 - if (!(cpus =3D virDomainCapsCPUModelsNew(n))) + if (!(defs =3D qemuMonitorCPUDefsNew(n))) return -1; =20 - if (type =3D=3D VIR_DOMAIN_VIRT_KVM) - qemuCaps->kvmCPUModels =3D cpus; - else - qemuCaps->tcgCPUModels =3D cpus; - for (i =3D 0; i < n; i++) { + qemuMonitorCPUDefInfoPtr cpu =3D defs->cpus + i; int usable =3D VIR_DOMCAPS_CPU_USABLE_UNKNOWN; VIR_AUTOFREE(char *) strUsable =3D NULL; - VIR_AUTOFREE(char *) name =3D NULL; VIR_AUTOFREE(xmlNodePtr *) blockerNodes =3D NULL; - VIR_AUTOSTRINGLIST blockers =3D NULL; int nblockers; =20 if ((strUsable =3D virXMLPropString(nodes[i], "usable")) && @@ -3546,8 +3540,9 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, strUsable); return -1; } + cpu->usable =3D usable; =20 - if (!(name =3D virXMLPropString(nodes[i], "name"))) { + if (!(cpu->name =3D virXMLPropString(nodes[i], "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing cpu name in QEMU capabilities cache"= )); return -1; @@ -3567,11 +3562,11 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, if (nblockers > 0) { size_t j; =20 - if (VIR_ALLOC_N(blockers, nblockers + 1) < 0) + if (VIR_ALLOC_N(cpu->blockers, nblockers + 1) < 0) return -1; =20 for (j =3D 0; j < nblockers; j++) { - if (!(blockers[j] =3D virXMLPropString(blockerNodes[j], "n= ame"))) { + if (!(cpu->blockers[j] =3D virXMLPropString(blockerNodes[j= ], "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing blocker name in QEMU " "capabilities cache")); @@ -3579,11 +3574,13 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, } } } - - if (virDomainCapsCPUModelsAddSteal(cpus, &name, usable, &blockers)= < 0) - return -1; } =20 + if (type =3D=3D VIR_DOMAIN_VIRT_KVM) + VIR_STEAL_PTR(qemuCaps->kvmCPUModels, defs); + else + VIR_STEAL_PTR(qemuCaps->tcgCPUModels, defs); + return 0; } =20 @@ -3993,23 +3990,23 @@ virQEMUCapsFormatCPUModels(virQEMUCapsPtr qemuCaps, virBufferPtr buf, virDomainVirtType type) { - virDomainCapsCPUModelsPtr cpus; + qemuMonitorCPUDefsPtr defs; const char *typeStr; size_t i; =20 if (type =3D=3D VIR_DOMAIN_VIRT_KVM) { typeStr =3D "kvm"; - cpus =3D qemuCaps->kvmCPUModels; + defs =3D qemuCaps->kvmCPUModels; } else { typeStr =3D "tcg"; - cpus =3D qemuCaps->tcgCPUModels; + defs =3D qemuCaps->tcgCPUModels; } =20 - if (!cpus) + if (!defs) return; =20 - for (i =3D 0; i < cpus->nmodels; i++) { - virDomainCapsCPUModelPtr cpu =3D cpus->models + i; + for (i =3D 0; i < defs->ncpus; i++) { + qemuMonitorCPUDefInfoPtr cpu =3D defs->cpus + i; =20 virBufferAsprintf(buf, "name); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153755; cv=none; d=zoho.com; s=zohoarc; b=DRHXjPdpoz2AiZUUfWwVUfRlWNqpU2Py8AUPGNHF4O/TPhiIwx0ZGH5QLa9oI6NYSW6FpIlDLto7FYHlOg26OrukrgpjdppeJDgtQS6yw0orEHycOzZ2EQKBzoZl6vwtLR5GLNdOB3FJG7pauvzi0+FjDIA1rMt578Bmdw/wgfo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153755; 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=aFJCCEpNo9X+4ScwK2+pSSJabVtO5YMr/1Y4fM/zxKE=; b=f7ixa3evqeDu+WfnlhBYAIqJJ3MOpOn7unOiiBhqRONm80JIOL/Scz+x/5Wk7gtNgdgo/BBRbGr3eXDwDDWuedn06DhdZPSr01pcInEDo6mbQo2GquFls6JQSYlUToLW+u7ie3nisYWRDZFYdORAXOhS43aN5IbAx/bAhcmVFCc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153755137519.8925388741941; Tue, 15 Oct 2019 08:35:55 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 7E5A818C428B; Tue, 15 Oct 2019 15:35:53 +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 4C95A60619; Tue, 15 Oct 2019 15:35:53 +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 016871803518; Tue, 15 Oct 2019 15:35:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZGWI024680 for ; Tue, 15 Oct 2019 11:35:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8FA1019C58; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 64C4419C5B for ; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 920BA101CE0; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:55 +0200 Message-Id: <43a491b0bfcaaa08df3886601702209316bdb17e.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 19/31] conf: Drop unused virDomainCapsCPUModelsFilter 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: , 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Tue, 15 Oct 2019 15:35:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/conf/domain_capabilities.c | 33 --------------------------------- src/conf/domain_capabilities.h | 3 --- src/libvirt_private.syms | 1 - 3 files changed, 37 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index ab8ebb650d..a13463a6e7 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -185,39 +185,6 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr o= ld) } =20 =20 -virDomainCapsCPUModelsPtr -virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr old, - const char **models, - const char **blacklist) -{ - virDomainCapsCPUModelsPtr cpuModels; - size_t i; - - if (!(cpuModels =3D virDomainCapsCPUModelsNew(0))) - return NULL; - - for (i =3D 0; i < old->nmodels; i++) { - if (models && !virStringListHasString(models, old->models[i].name)) - continue; - - if (blacklist && virStringListHasString(blacklist, old->models[i].= name)) - continue; - - if (virDomainCapsCPUModelsAdd(cpuModels, - old->models[i].name, - old->models[i].usable, - old->models[i].blockers) < 0) - goto error; - } - - return cpuModels; - - error: - virObjectUnref(cpuModels); - return NULL; -} - - int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, char **name, diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index e3bd8d423e..bdd0bd9253 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -195,9 +195,6 @@ virDomainCapsPtr virDomainCapsNew(const char *path, =20 virDomainCapsCPUModelsPtr virDomainCapsCPUModelsNew(size_t nmodels); virDomainCapsCPUModelsPtr virDomainCapsCPUModelsCopy(virDomainCapsCPUModel= sPtr old); -virDomainCapsCPUModelsPtr virDomainCapsCPUModelsFilter(virDomainCapsCPUMod= elsPtr old, - const char **models, - const char **blackl= ist); int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, char **name, virDomainCapsCPUUsable usable, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 1af18b880b..641b1f93bd 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -193,7 +193,6 @@ virDomainAuditVcpu; virDomainCapsCPUModelsAdd; virDomainCapsCPUModelsAddSteal; virDomainCapsCPUModelsCopy; -virDomainCapsCPUModelsFilter; virDomainCapsCPUModelsGet; virDomainCapsCPUModelsNew; virDomainCapsCPUUsableTypeFromString; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153751; cv=none; d=zoho.com; s=zohoarc; b=Bp7aKGwXL9D5EqhDFW6sTkwLW/kwKBB5WWetMPJm68NhqscEjx3MGfelTmSJt3ipehsulA4MOsHRru9UkXMIcPdMH+4aomO9diAnPIaO9jp5S2ugPCh9r+89fPTqD2sYowlIvA5osoFnM3+KYj0VJTkNcD0Ov5XLjJdV27J28aw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153751; 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=srePd1gTDaTNAOeazzQLjOEn9zsfCrYMdDczbq5PRbM=; b=nUqHpOleGezGwmMIHLYOXjqa/L++g34LmtbsHnq4/eH46avlBxzGjCdcnQaxqfV5Ie1EvXJj/G1EAFYSwmN+lwMqqSfrZwxEV9p/qvLAqVnYgSuoHAeF811oYNDitNIj80rNUY6UbqbnAuFs8ovd9JGIdhHZxleLvvSioLflZnI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 157115375168036.69011473617718; Tue, 15 Oct 2019 08:35:51 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id A9D6D10CC202; Tue, 15 Oct 2019 15:35:49 +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 812E33CC8; Tue, 15 Oct 2019 15:35:49 +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 3BFBB180BAA1; Tue, 15 Oct 2019 15:35:49 +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 x9FFZGKe024681 for ; Tue, 15 Oct 2019 11:35:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9067E5D6B0; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6564D5D6A9 for ; Tue, 15 Oct 2019 15:35:16 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 9810F101CE1; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:56 +0200 Message-Id: <609a80f179afe07001e065e1eec2bb2e88c5fb02.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 20/31] conf: Drop virDomainCapsCPUModelsAddSteal 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Tue, 15 Oct 2019 15:35:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Both virDomainCapsCPUModelsAdd and virDomainCapsCPUModelsAddSteal are so simple we can just squash the code in a single function. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/conf/domain_capabilities.c | 33 ++++++++++----------------------- src/conf/domain_capabilities.h | 4 ---- src/libvirt_private.syms | 1 - 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index a13463a6e7..dadb2a1183 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -185,27 +185,6 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr o= ld) } =20 =20 -int -virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, - char **name, - virDomainCapsCPUUsable usable, - char ***blockers) -{ - if (VIR_RESIZE_N(cpuModels->models, cpuModels->nmodels_max, - cpuModels->nmodels, 1) < 0) - return -1; - - cpuModels->models[cpuModels->nmodels].usable =3D usable; - VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].name, *name); - - if (blockers) - VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].blockers, *blo= ckers); - - cpuModels->nmodels++; - return 0; -} - - int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, @@ -214,6 +193,7 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpu= Models, { VIR_AUTOFREE(char *) nameCopy =3D NULL; VIR_AUTOSTRINGLIST blockersCopy =3D NULL; + virDomainCapsCPUModelPtr cpu; =20 if (VIR_STRDUP(nameCopy, name) < 0) return -1; @@ -221,10 +201,17 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr c= puModels, if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0) return -1; =20 - if (virDomainCapsCPUModelsAddSteal(cpuModels, &nameCopy, - usable, &blockersCopy) < 0) + if (VIR_RESIZE_N(cpuModels->models, cpuModels->nmodels_max, + cpuModels->nmodels, 1) < 0) return -1; =20 + cpu =3D cpuModels->models + cpuModels->nmodels; + cpuModels->nmodels++; + + cpu->usable =3D usable; + VIR_STEAL_PTR(cpu->name, nameCopy); + VIR_STEAL_PTR(cpu->blockers, blockersCopy); + return 0; } =20 diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index bdd0bd9253..8b220e3bf8 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -195,10 +195,6 @@ virDomainCapsPtr virDomainCapsNew(const char *path, =20 virDomainCapsCPUModelsPtr virDomainCapsCPUModelsNew(size_t nmodels); virDomainCapsCPUModelsPtr virDomainCapsCPUModelsCopy(virDomainCapsCPUModel= sPtr old); -int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, - char **name, - virDomainCapsCPUUsable usable, - char ***blockers); int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, virDomainCapsCPUUsable usable, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 641b1f93bd..b35934be1f 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -191,7 +191,6 @@ virDomainAuditVcpu; =20 # conf/domain_capabilities.h virDomainCapsCPUModelsAdd; -virDomainCapsCPUModelsAddSteal; virDomainCapsCPUModelsCopy; virDomainCapsCPUModelsGet; virDomainCapsCPUModelsNew; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153768; cv=none; d=zoho.com; s=zohoarc; b=ilKj//P8XWCwiQyxOO5xRLrdNrpXIrnbEAenoSMsSZaCPRyDpKne5uE/btgt696zz2t9UHBcXOaq2h3ll9mwmLp0C1jhkoSjuRT7JRwBAlrG19IUK3Qlf6bLd7rmrRVsLi5GdIbx+FtP+M8YAGH1CFaiiigf8JlntSRU/WqhlzI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153768; 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=2p5KwLEimJ7xy8quK9k5G9uoXt4VIcNuXPGG3BN9HTA=; b=arK/Dg1X2rQW1igGfe9zcvq5At/Iv/3vFEnfIbkQXFhC94Nkih9p0yyl83QIu1fKKv5hhDZqnWQhX81cbMowh4dc77njpU8Yuu1BvDvre8312bGcGKc856oQuWINowMfGNfYUZMbAbMnswXWChjbN5Op32XShGZDV2aldSkluuM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153768970511.33052730303416; Tue, 15 Oct 2019 08:36:08 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 33A432101; Tue, 15 Oct 2019 15:36:07 +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 0A32E60A9D; Tue, 15 Oct 2019 15:36:07 +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 A7749180BAA6; Tue, 15 Oct 2019 15:36:06 +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 x9FFZHgC024743 for ; Tue, 15 Oct 2019 11:35:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id EDAD760166; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9CC0460127 for ; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 9E646101CE2; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:57 +0200 Message-Id: <4b44ff8b34ecbdc174c09c39f018c0407f95f2c2.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 21/31] qemu: Store typename from query-cpu-definitions in qemuCaps 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: , 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Tue, 15 Oct 2019 15:36:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We need to create a mapping between CPU model names and their corresponding QOM types. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - ignore empty typename strings src/qemu/qemu_capabilities.c | 3 + src/qemu/qemu_monitor.c | 2 + src/qemu/qemu_monitor.h | 1 + src/qemu/qemu_monitor_json.c | 5 + .../caps_2.10.0.aarch64.xml | 126 ++--- .../caps_2.10.0.ppc64.xml | 512 ++++++++--------- .../caps_2.10.0.s390x.xml | 264 ++++----- .../caps_2.10.0.x86_64.xml | 132 ++--- .../caps_2.11.0.s390x.xml | 264 ++++----- .../caps_2.11.0.x86_64.xml | 136 ++--- .../caps_2.12.0.aarch64.xml | 136 ++--- .../caps_2.12.0.ppc64.xml | 516 +++++++++--------- .../caps_2.12.0.s390x.xml | 264 ++++----- .../caps_2.12.0.x86_64.xml | 180 +++--- .../qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 512 ++++++++--------- .../qemucapabilitiesdata/caps_2.9.0.s390x.xml | 256 ++++----- .../caps_2.9.0.x86_64.xml | 128 ++--- .../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 516 +++++++++--------- .../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 272 ++++----- .../caps_3.0.0.x86_64.xml | 184 +++---- .../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 516 +++++++++--------- .../caps_3.1.0.x86_64.xml | 196 +++---- .../caps_4.0.0.aarch64.xml | 148 ++--- .../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 516 +++++++++--------- .../qemucapabilitiesdata/caps_4.0.0.s390x.xml | 284 +++++----- .../caps_4.0.0.x86_64.xml | 196 +++---- .../caps_4.1.0.x86_64.xml | 400 +++++++------- .../caps_4.2.0.aarch64.xml | 148 ++--- .../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 516 +++++++++--------- .../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 300 +++++----- .../caps_4.2.0.x86_64.xml | 400 +++++++------- 31 files changed, 4020 insertions(+), 4009 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a274cef120..2a32d575c9 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3548,6 +3548,8 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps, return -1; } =20 + cpu->type =3D virXMLPropString(nodes[i], "typename"); + node =3D ctxt->node; ctxt->node =3D nodes[i]; nblockers =3D virXPathNodeSet("./blocker", ctxt, &blockerNodes); @@ -4010,6 +4012,7 @@ virQEMUCapsFormatCPUModels(virQEMUCapsPtr qemuCaps, =20 virBufferAsprintf(buf, "name); + virBufferEscapeString(buf, " typename=3D'%s'", cpu->type); if (cpu->usable) { virBufferAsprintf(buf, " usable=3D'%s'", virDomainCapsCPUUsableTypeToString(cpu->usab= le)); diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 8d86112f30..6056219674 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3559,6 +3559,7 @@ qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs) for (i =3D 0; i < defs->ncpus; i++) { virStringListFree(defs->cpus[i].blockers); VIR_FREE(defs->cpus[i].name); + VIR_FREE(defs->cpus[i].type); } =20 VIR_FREE(defs->cpus); @@ -3605,6 +3606,7 @@ qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr *dst, cpuDst->usable =3D cpuSrc->usable; =20 if (VIR_STRDUP(cpuDst->name, cpuSrc->name) < 0 || + VIR_STRDUP(cpuDst->type, cpuSrc->type) < 0 || virStringListCopy(&cpuDst->blockers, (const char **)cpuSrc->blockers) < 0) return -1; diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 4f355c760a..f2af1badd4 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1098,6 +1098,7 @@ typedef qemuMonitorCPUDefInfo *qemuMonitorCPUDefInfoP= tr; struct _qemuMonitorCPUDefInfo { virTristateBool usable; char *name; + char *type; char **blockers; /* NULL-terminated string list */ }; =20 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index de75c46dc1..bc30884223 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5571,6 +5571,11 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, if (VIR_STRDUP(cpu->name, tmp) < 0) return -1; =20 + if ((tmp =3D virJSONValueObjectGetString(child, "typename")) && + *tmp && + VIR_STRDUP(cpu->type, tmp) < 0) + return -1; + if (virJSONValueObjectHasKey(child, "unavailable-features")) { virJSONValuePtr blockers; size_t j; ... diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.2.0.x86_64.xml index ab884239fe..176613fa2a 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -621,14 +621,14 @@ - - - - - - - - + + + + + + + + @@ -636,7 +636,7 @@ - + ... --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153774; cv=none; d=zoho.com; s=zohoarc; b=cNbdzZyHYw/bE+P3nMnwqwXuXmQEd3qhbyUk18l5g+kveUTbp3N6WfRpHoPKJD0IWz8DmeHCFuxmXiEJ9qsxebuPcfB47cE7EtXctcotKcCA8YeFyMZCZVnrAx3tt4fuIB4cKsrXAuYPTr9c+73El7WCNTXz1RbDs9nb4s1bidM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153774; 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=xS47ymss6t+7+Zw1+vuyelreFQOchNQHBtp1+AGj/Kw=; b=lPMdul4vF0bfELX99+0dlZ93ggGCukxdzu2NOhZCCDI0Jvp8Qgaqjz4jbpaid546qoNzjDjKi3oxtHlYn7b6fteIqutMKmqZgr8NzD5wtlPhw9wZ8LrnW9999cGK++mTqqVwlGa82ViQJP9n4FFUE6KyhKqxZbaV+XR4dq3thcA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153774139943.6603497492862; Tue, 15 Oct 2019 08:36:14 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 3880911A1F; Tue, 15 Oct 2019 15:36:12 +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 02B55194BB; Tue, 15 Oct 2019 15:36:12 +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 A0136180BAA9; Tue, 15 Oct 2019 15:36:11 +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 x9FFZIWK024748 for ; Tue, 15 Oct 2019 11:35:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2404360127; Tue, 15 Oct 2019 15:35:18 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0A806012E for ; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id A6354101CE3; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:58 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 22/31] qemu: Probe for default CPU types 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 15 Oct 2019 15:36:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" QEMU 4.2.0 will report default CPU types used by each machine type and we will want to start using it. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change except for updated test results src/qemu/qemu_capabilities.c | 15 ++- src/qemu/qemu_monitor.c | 1 + src/qemu/qemu_monitor.h | 1 + src/qemu/qemu_monitor_json.c | 12 +++ .../caps_4.2.0.aarch64.xml | 94 +++++++++---------- .../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 58 ++++++------ .../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 28 +++--- .../caps_4.2.0.x86_64.xml | 92 +++++++++--------- 8 files changed, 163 insertions(+), 138 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2a32d575c9..33cd3491b2 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -556,6 +556,7 @@ struct virQEMUCapsMachineType { unsigned int maxCpus; bool hotplugCpus; bool qemuDefault; + char *defaultCPU; }; =20 typedef struct _virQEMUCapsHostCPUData virQEMUCapsHostCPUData; @@ -1638,7 +1639,8 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemu= Caps) ret->nmachineTypes =3D qemuCaps->nmachineTypes; for (i =3D 0; i < qemuCaps->nmachineTypes; i++) { if (VIR_STRDUP(ret->machineTypes[i].name, qemuCaps->machineTypes[i= ].name) < 0 || - VIR_STRDUP(ret->machineTypes[i].alias, qemuCaps->machineTypes[= i].alias) < 0) + VIR_STRDUP(ret->machineTypes[i].alias, qemuCaps->machineTypes[= i].alias) < 0 || + VIR_STRDUP(ret->machineTypes[i].defaultCPU, qemuCaps->machineT= ypes[i].defaultCPU) < 0) goto error; ret->machineTypes[i].maxCpus =3D qemuCaps->machineTypes[i].maxCpus; ret->machineTypes[i].hotplugCpus =3D qemuCaps->machineTypes[i].hot= plugCpus; @@ -1673,6 +1675,7 @@ void virQEMUCapsDispose(void *obj) for (i =3D 0; i < qemuCaps->nmachineTypes; i++) { VIR_FREE(qemuCaps->machineTypes[i].name); VIR_FREE(qemuCaps->machineTypes[i].alias); + VIR_FREE(qemuCaps->machineTypes[i].defaultCPU); } VIR_FREE(qemuCaps->machineTypes); =20 @@ -2406,7 +2409,8 @@ virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCa= ps, mach =3D &(qemuCaps->machineTypes[qemuCaps->nmachineTypes++]); =20 if (VIR_STRDUP(mach->alias, machines[i]->alias) < 0 || - VIR_STRDUP(mach->name, machines[i]->name) < 0) + VIR_STRDUP(mach->name, machines[i]->name) < 0 || + VIR_STRDUP(mach->defaultCPU, machines[i]->defaultCPU) < 0) goto cleanup; =20 mach->maxCpus =3D machines[i]->maxCpus; @@ -3843,6 +3847,8 @@ virQEMUCapsLoadCache(virArch hostArch, if (STREQ_NULLABLE(str, "yes")) qemuCaps->machineTypes[i].qemuDefault =3D true; VIR_FREE(str); + + qemuCaps->machineTypes[i].defaultCPU =3D virXMLPropString(node= s[i], "defaultCPU"); } } VIR_FREE(nodes); @@ -4116,6 +4122,11 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps) qemuCaps->machineTypes[i].maxCpus); if (qemuCaps->machineTypes[i].qemuDefault) virBufferAddLit(&buf, " default=3D'yes'"); + + if (qemuCaps->machineTypes[i].defaultCPU) + virBufferEscapeString(&buf, " defaultCPU=3D'%s'", + qemuCaps->machineTypes[i].defaultCPU); + virBufferAddLit(&buf, "/>\n"); } =20 diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 6056219674..6f2d759a78 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3532,6 +3532,7 @@ qemuMonitorMachineInfoFree(qemuMonitorMachineInfoPtr = machine) return; VIR_FREE(machine->name); VIR_FREE(machine->alias); + VIR_FREE(machine->defaultCPU); VIR_FREE(machine); } =20 diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index f2af1badd4..c099321ad1 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1085,6 +1085,7 @@ struct _qemuMonitorMachineInfo { char *alias; unsigned int maxCpus; bool hotplugCpus; + char *defaultCPU; }; =20 int qemuMonitorGetMachines(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index bc30884223..1309b6a781 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5504,6 +5504,18 @@ int qemuMonitorJSONGetMachines(qemuMonitorPtr mon, =20 ignore_value(virJSONValueObjectGetBoolean(child, "hotpluggable-cpu= s", &info->hotplugCpus)); + + if (virJSONValueObjectHasKey(child, "default-cpu-type")) { + if (!(tmp =3D virJSONValueObjectGetString(child, "default-cpu-= type"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("query-machines reply has malformed " + "'default-cpu-type' data")); + goto cleanup; + } + + if (VIR_STRDUP(info->defaultCPU, tmp) < 0) + goto cleanup; + } } =20 ret =3D n; diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml b/tests/qemu= capabilitiesdata/caps_4.2.0.aarch64.xml index a416defca0..8addadb564 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.aarch64.xml @@ -246,76 +246,76 @@ - + - - - - + + + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + - - - - - - + + + + + + - + - - - + + + - + - - - - - - + + + + + + - + - - - - + + + + - + - + - + diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_4.2.0.ppc64.xml index 3ec7686b12..b4ceb6a1e8 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml @@ -1053,35 +1053,35 @@ - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml b/tests/qemuca= pabilitiesdata/caps_4.2.0.s390x.xml index 14783c8d1d..3d2ba7983b 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.s390x.xml @@ -3328,18 +3328,18 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_4.2.0.x86_64.xml index 176613fa2a..e87bb84a9e 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml @@ -1904,50 +1904,50 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153839; cv=none; d=zoho.com; s=zohoarc; b=H8FGFofevl4cUQowX2B6tx80dOsT11Pe2UF6CL+brActqz+GPp0YNaOASPn4TphCT8fiqPBSDgTI4qRJpYCkGpLTEsUXx1VNrVhj5pL1TYqD5WXOsF2vSOAF3TC+x0FG8VVcqSN6zcmgSTtIfUgzRVgWrxpJXFQHl3iT/9xaDBc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153839; 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=UsC8pi6vFM0iBK2GWLVR5sk81A/CSbmL24Ta8k50mIM=; b=DPAjDLFjObgsKz+eguHrGpsaw9btCoBMjJeZ7VioPIsgho6a/8UdQUI8D19WTMRdldXzW0tbFmo4SCXuaklRaPOJJtdZV29GBY593vh5k6jE5IFjagO7wwVd2RiywXXO3DhWlndq/Qq2v8sQ8LHuqyD6bDNlmLQAFJGEPA357gc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153839936447.80280352410716; Tue, 15 Oct 2019 08:37:19 -0700 (PDT) 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 C7D55309B15D; Tue, 15 Oct 2019 15:37:17 +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 9E60761559; Tue, 15 Oct 2019 15:37:17 +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 5ABAD180BAA8; Tue, 15 Oct 2019 15:37:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZH6H024722 for ; Tue, 15 Oct 2019 11:35:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id CA9773CC8; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0C5819C58 for ; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id AC1C0101CE4; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:34:59 +0200 Message-Id: <3d6994339ba4ef5f944ad70a863d375db98a0c66.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 23/31] qemu: Introduce virQEMUCapsGetMachineDefaultCPU 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: , 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.49]); Tue, 15 Oct 2019 15:37:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - fix crash with CPUs without type src/qemu/qemu_capabilities.c | 36 ++++++++++++++++++++++++++++++++++++ src/qemu/qemu_capabilities.h | 3 +++ 2 files changed, 39 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 33cd3491b2..dd7ea9ae86 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2179,6 +2179,42 @@ bool virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr= qemuCaps, } =20 =20 +const char * +virQEMUCapsGetMachineDefaultCPU(virQEMUCapsPtr qemuCaps, + const char *name, + virDomainVirtType type) +{ + qemuMonitorCPUDefsPtr defs; + const char *cpuType =3D NULL; + size_t i; + + if (type =3D=3D VIR_DOMAIN_VIRT_KVM) + defs =3D qemuCaps->kvmCPUModels; + else + defs =3D qemuCaps->tcgCPUModels; + + if (!name || !defs) + return NULL; + + for (i =3D 0; i < qemuCaps->nmachineTypes; i++) { + if (STREQ(qemuCaps->machineTypes[i].name, name)) { + cpuType =3D qemuCaps->machineTypes[i].defaultCPU; + break; + } + } + + if (!cpuType) + return NULL; + + for (i =3D 0; i < defs->ncpus; i++) { + if (STREQ_NULLABLE(defs->cpus[i].type, cpuType)) + return defs->cpus[i].name; + } + + return NULL; +} + + /** * virQEMUCapsSetGICCapabilities: * @qemuCaps: QEMU capabilities diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 923706c3bf..f5133d083d 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -607,6 +607,9 @@ int virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCap= s, const char *name); bool virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr qemuCaps, const char *name); +const char *virQEMUCapsGetMachineDefaultCPU(virQEMUCapsPtr qemuCaps, + const char *name, + virDomainVirtType type); int virQEMUCapsGetMachineTypesCaps(virQEMUCapsPtr qemuCaps, size_t *nmachines, virCapsGuestMachinePtr **machines); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153843; cv=none; d=zoho.com; s=zohoarc; b=HIwNLJuPVjyCVt9DlKu1I2DwA5vqgBOwvZd4427+ViMLEm1UzFBgIQPkolLXQJFS0obZgL3Bv1VQHhULcFA4HxQXZfezcJYC/dvi3GLhztDq0wzczX/hOnIGONZx0NRR7zHnElfg2C6WCvbhdJHjC14oZh9AJaOQ+6S4xBGXKN8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153843; 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=jZ4E+XixFmvL5uaVd+2NYAiOvK5cyh0yycdA7FsyXY4=; b=LUfARVrfJClHiCWRXqn6J2NYXTAhxdTonXaZ3MjRzEbAmgUWHb2SonkN6MqswdHkHgwPQ44i3XmeLilG8jSZO9FZQXCnCzHwE+LRtXeWGbbsOaKsbVziRA3dCOCi7xFI/QmXq1AlQzc4PTCEQCTZc8EAPKJQp8x1sdn8TawDxuc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153843934460.66881395790915; Tue, 15 Oct 2019 08:37:23 -0700 (PDT) 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 5D035A3CD9E; Tue, 15 Oct 2019 15:37:21 +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 371DC61559; Tue, 15 Oct 2019 15:37:21 +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 ED740206CF; Tue, 15 Oct 2019 15:37:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZHRe024723 for ; Tue, 15 Oct 2019 11:35:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id D03B45DAAE; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3C175D9CD for ; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id B22AE101CE5; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:35:00 +0200 Message-Id: <28bb36890377c95744c967be0c57eacb4f4ae567.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 24/31] qemu: Drop unused virQEMUCapsGetDefaultMachine 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: , 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.6.2 (mx1.redhat.com [10.5.110.68]); Tue, 15 Oct 2019 15:37:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/qemu/qemu_capabilities.c | 12 ------------ src/qemu/qemu_capabilities.h | 1 - 2 files changed, 13 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index dd7ea9ae86..bd54c1751c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2133,18 +2133,6 @@ const char *virQEMUCapsGetCanonicalMachine(virQEMUCa= psPtr qemuCaps, return name; } =20 -const char * -virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps) -{ - size_t i; - - for (i =3D 0; i < qemuCaps->nmachineTypes; i++) { - if (qemuCaps->machineTypes[i].qemuDefault) - return qemuCaps->machineTypes[i].name; - } - - return NULL; -} =20 int virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCaps, const char *name) diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index f5133d083d..feb6a9ecd0 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -602,7 +602,6 @@ bool virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuC= aps, virCPUMode mode); const char *virQEMUCapsGetCanonicalMachine(virQEMUCapsPtr qemuCaps, const char *name); -const char *virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps); int virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCaps, const char *name); bool virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr qemuCaps, --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153765; cv=none; d=zoho.com; s=zohoarc; b=BvLKsS+VMi6cQc6ThLhemrWbWlo5TnZKtszJfQxJ0FiL/e98BNjLMu2lw87j7f+TC473JFXeHHlYR+2QcQq0E41mXPX/lvoQkJAAtptE1PHfODB3v+JAS1XrqEPBVo5NqDuI5+L9NnxUV6MpRbdhDm8qVYLmh+vve/h7U9R6byk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153765; 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=Qv2dPrhBObaAC7pH/ucLswNTW2PUb7lAG1q9hqFbqhI=; b=i9BMei6On9Q9D71dNS0VY2p90vt4KkHvDiC4kVbgcIOH+H/xITJTu9hCoyp4lsTdAS/ZgUx48MPBVQdCK3kyHZrSYbBdcsKdO2Zo7sTks3T7wQoFgsn3+wQg5gCEbieJ2Tc3WzZ4/Tb56cdNd2ePVwitm7Dmo/CZPli/dgHR1Gc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153765950721.1962227648767; Tue, 15 Oct 2019 08:36:05 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 3A78C210F; Tue, 15 Oct 2019 15:36: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 071F6100EBD6; Tue, 15 Oct 2019 15:36: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 AD19C180BAA2; Tue, 15 Oct 2019 15:36:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZHHL024724 for ; Tue, 15 Oct 2019 11:35:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id D3D6560C5E; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A82A560BE2 for ; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id B81E3101CE6; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:35:01 +0200 Message-Id: <174391b58ca3a44eace9f2d644e862b1164cbac3.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 25/31] qemu: Use VIR_AUTOUNREF in qemuDomainDefPostParse 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Tue, 15 Oct 2019 15:36:04 +0000 (UTC) Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/qemu/qemu_domain.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c638077aa8..9dcba4ef38 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4617,55 +4617,51 @@ qemuDomainDefPostParse(virDomainDefPtr def, void *parseOpaque) { virQEMUDriverPtr driver =3D opaque; - virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); + VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg =3D virQEMUDriverGetConfig(d= river); /* Note that qemuCaps may be NULL when this function is called. This * function shall not fail in that case. It will be re-run on VM start= up * with the capabilities populated. */ virQEMUCapsPtr qemuCaps =3D parseOpaque; - int ret =3D -1; =20 if (def->os.bootloader || def->os.bootloaderArgs) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("bootloader is not supported by QEMU")); - goto cleanup; + return -1; } =20 if (!def->os.machine) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing machine type")); - goto cleanup; + return -1; } =20 if (qemuDomainNVRAMPathGenerate(cfg, def) < 0) - goto cleanup; + return -1; =20 if (qemuDomainDefAddDefaultDevices(def, qemuCaps) < 0) - goto cleanup; + return -1; =20 if (qemuCanonicalizeMachine(def, qemuCaps) < 0) - goto cleanup; + return -1; =20 qemuDomainDefEnableDefaultFeatures(def, qemuCaps); =20 if (qemuDomainRecheckInternalPaths(def, cfg, parseFlags) < 0) - goto cleanup; + return -1; =20 if (qemuSecurityVerify(driver->securityManager, def) < 0) - goto cleanup; + return -1; =20 if (qemuDomainDefVcpusPostParse(def) < 0) - goto cleanup; + return -1; =20 if (qemuDomainDefCPUPostParse(def) < 0) - goto cleanup; + return -1; =20 if (qemuDomainDefTsegPostParse(def, qemuCaps) < 0) - goto cleanup; + return -1; =20 - ret =3D 0; - cleanup: - virObjectUnref(cfg); - return ret; + return 0; } =20 =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153849; cv=none; d=zoho.com; s=zohoarc; b=IoQFOKCV5OV69EZRriM2uT/egR1zlfKlAJzgwzN6Dqm4lAOpRwnF7mSVqHLF2a2sH6btTug0n9HofiTsErDqjQjha3ZUaxQaxFxCfI/vjU45wiV+flvpVb+0+jlhzORh9XEHZxGJCUH9Mbo3Kdxl6jxifv7APDqtqHEBbNPj1NM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153849; 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=ZVL0lTOkcPaIcdkOaOya19mn/jCOUx6/cVLg0nFsgb4=; b=XGP70iQVbi4M1FQd/cDpejB4GENj+klwukRtrjjrT8dbQ/GJ3VM4FxnPZO37w4f8Xx0vvVyjAwaRZdwcY67RikYsdlAytWK2938jO6lImXmIW2j9cebA1IYPpiOt/fp4DhDQJPiujXtt8iYHmzUTGGVibYVwBST2h1n3FWRzdUE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153849416162.30864452576657; Tue, 15 Oct 2019 08:37:29 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 0E5ED801688; Tue, 15 Oct 2019 15:37:27 +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 8594064020; Tue, 15 Oct 2019 15:37:25 +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 CEFF5149F5; Tue, 15 Oct 2019 15:37:24 +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 x9FFZHfo024725 for ; Tue, 15 Oct 2019 11:35:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id D47CD5D6B0; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A9FA55D6A9 for ; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id BE2BD101CE7; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:35:02 +0200 Message-Id: <3b4b90ecd7f2fd212229500c705baf05dbf7ef1b.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 26/31] conf: Define VIR_AUTOPTR for virCPUDef 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: , 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Tue, 15 Oct 2019 15:37:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change src/conf/cpu_conf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index 30904fab95..230e75f077 100644 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -151,6 +151,7 @@ virCPUDefFreeModel(virCPUDefPtr def); =20 void virCPUDefFree(virCPUDefPtr def); +VIR_DEFINE_AUTOPTR_FUNC(virCPUDef, virCPUDefFree); =20 int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) virCPUDefCopyModel(virCPUDefPtr dst, --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153770; cv=none; d=zoho.com; s=zohoarc; b=PGPUjB/wkw6NG0DsmkvNi/Glr2HLaKwwtRYmZ+hrK8drgbTZZIrur4u+hHIuE/u5na5rUNYYsG3T0g0VCP9m9wQZYOO+eCw5ta3PIsTDlShURCwyS/MUUCvUqtKV6CCN9wgW2TlrEiTmly88ObnyZTnnl9yLJ9pBD+423MwMP70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153770; 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=WmTeXLXBKRbEvwoM00LM58FXu5amyy5VZVggu0ZPgMg=; b=Xnww4pPRiEzdLx2RLvmX9KQKzWVpbIcJ5RdajH5lAocy5l4tU1+iJZXpOLJB47fZd1ZWBh4osPILwxRmB/6d4nRohInTOrsk+nX5eeT+xL5VmAROD51ncfP8Ej7OXIGOcIr3RfmbfNN+hNSqqOUSNZzQh6FG3FAYixzPMtOkqsA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153770712902.7574095707204; Tue, 15 Oct 2019 08:36:10 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id CAA902A09B1; Tue, 15 Oct 2019 15:36:08 +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 9941C6061E; Tue, 15 Oct 2019 15:36:08 +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 3A5012551C; Tue, 15 Oct 2019 15:36:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZICW024751 for ; Tue, 15 Oct 2019 11:35:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2B68E60BE2; Tue, 15 Oct 2019 15:35:18 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD88860C57 for ; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id C4E06101CE8; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:35:03 +0200 Message-Id: <1e035b1066993a96754668eea0ab9b6103f76284.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 27/31] qemuxml2*test: Add test cases for default CPU models on aarch64 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: , 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 15 Oct 2019 15:36:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - new patch ...fault-cpu-kvm-virt-4.2.aarch64-latest.args | 38 +++++++++++++++++++ .../aarch64-default-cpu-kvm-virt-4.2.xml | 20 ++++++++++ ...fault-cpu-tcg-virt-4.2.aarch64-latest.args | 38 +++++++++++++++++++ .../aarch64-default-cpu-tcg-virt-4.2.xml | 20 ++++++++++ tests/qemuxml2argvtest.c | 3 ++ ...efault-cpu-kvm-virt-4.2.aarch64-latest.xml | 38 +++++++++++++++++++ ...efault-cpu-tcg-virt-4.2.aarch64-latest.xml | 38 +++++++++++++++++++ tests/qemuxml2xmltest.c | 3 ++ 8 files changed, 198 insertions(+) create mode 100644 tests/qemuxml2argvdata/aarch64-default-cpu-kvm-virt-4.2= .aarch64-latest.args create mode 100644 tests/qemuxml2argvdata/aarch64-default-cpu-kvm-virt-4.2= .xml create mode 100644 tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2= .aarch64-latest.args create mode 100644 tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2= .xml create mode 100644 tests/qemuxml2xmloutdata/aarch64-default-cpu-kvm-virt-4= .2.aarch64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/aarch64-default-cpu-tcg-virt-4= .2.aarch64-latest.xml diff --git a/tests/qemuxml2argvdata/aarch64-default-cpu-kvm-virt-4.2.aarch6= 4-latest.args b/tests/qemuxml2argvdata/aarch64-default-cpu-kvm-virt-4.2.aar= ch64-latest.args new file mode 100644 index 0000000000..fe33d5410a --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-default-cpu-kvm-virt-4.2.aarch64-lates= t.args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-aarch64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine virt-4.2,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff,gic-version= =3D3 \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device pcie-root-port,port=3D0x8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,mult= ifunction=3Don,\ +addr=3D0x1 \ +-device pcie-root-port,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.1,addr=3D0x0,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/aarch64-default-cpu-kvm-virt-4.2.xml b/= tests/qemuxml2argvdata/aarch64-default-cpu-kvm-virt-4.2.xml new file mode 100644 index 0000000000..1267306ebf --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-default-cpu-kvm-virt-4.2.xml @@ -0,0 +1,20 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 1 + + hvm + + + + + /usr/bin/qemu-system-aarch64 + + + + + + + diff --git a/tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2.aarch6= 4-latest.args b/tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2.aar= ch64-latest.args new file mode 100644 index 0000000000..5ecbe1fdd6 --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2.aarch64-lates= t.args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-aarch64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine virt-4.2,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,gic-version= =3D2 \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device pcie-root-port,port=3D0x8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,mult= ifunction=3Don,\ +addr=3D0x1 \ +-device pcie-root-port,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.1,addr=3D0x0,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2.xml b/= tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2.xml new file mode 100644 index 0000000000..20ef1228ce --- /dev/null +++ b/tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2.xml @@ -0,0 +1,20 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 1 + + hvm + + + + + /usr/bin/qemu-system-aarch64 + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5212ce50bd..b88518b2ff 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3034,6 +3034,9 @@ mymain(void) DO_TEST_CAPS_LATEST("vhost-user-vga"); DO_TEST_CAPS_LATEST("vhost-user-gpu-secondary"); =20 + DO_TEST_CAPS_ARCH_LATEST("aarch64-default-cpu-kvm-virt-4.2", "aarch64"= ); + DO_TEST_CAPS_ARCH_LATEST("aarch64-default-cpu-tcg-virt-4.2", "aarch64"= ); + if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); =20 diff --git a/tests/qemuxml2xmloutdata/aarch64-default-cpu-kvm-virt-4.2.aarc= h64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-default-cpu-kvm-virt-4.2.= aarch64-latest.xml new file mode 100644 index 0000000000..efbe726758 --- /dev/null +++ b/tests/qemuxml2xmloutdata/aarch64-default-cpu-kvm-virt-4.2.aarch64-lat= est.xml @@ -0,0 +1,38 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + + + + +
+ + + + + +
+ + + + +
+ + + diff --git a/tests/qemuxml2xmloutdata/aarch64-default-cpu-tcg-virt-4.2.aarc= h64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-default-cpu-tcg-virt-4.2.= aarch64-latest.xml new file mode 100644 index 0000000000..1f4104857a --- /dev/null +++ b/tests/qemuxml2xmloutdata/aarch64-default-cpu-tcg-virt-4.2.aarch64-lat= est.xml @@ -0,0 +1,38 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-aarch64 + + + + +
+ + + + + +
+ + + + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index b9364f942f..fee5dc66a1 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1340,6 +1340,9 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("x86_64-pc-graphics", "x86_64"); DO_TEST_CAPS_ARCH_LATEST("x86_64-q35-graphics", "x86_64"); =20 + DO_TEST_CAPS_ARCH_LATEST("aarch64-default-cpu-kvm-virt-4.2", "aarch64"= ); + DO_TEST_CAPS_ARCH_LATEST("aarch64-default-cpu-tcg-virt-4.2", "aarch64"= ); + if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153778; cv=none; d=zoho.com; s=zohoarc; b=PaF52ToRJGv6rv6vjsRf9grWAfzV0TggkxoRzFyfx/nqkAT0USwP5zJwA4bsWWsezWXp9IOX8+39DN4JiRSBmUTvPk1JHIbzmukpwiwLnd1mp4X7FdRzVKKLfkVjtUMit2qi+qO4O+7LWhEpT7Iyt647Nu5LCPKnEDImPanvez0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153778; 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=eANHL1LqWgxTbW/03zsNblJDkotYId2N8WP6vLcACDk=; b=khWvwI8Ws6W+S0Ia1nRXvS/E0/Ni+XdKADNVHl3XyvyfVOVpdYC04sxmGqRMa61o0UMTdo0muQGC9JJlTPbHtWagVFPj8DR6ox4Eb1V3VlR852ZL5TBZkuWK1dTAeieOJYWjb+YrVxgYXU8m21EkH3s82w/28nawulEUYKaDMPI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153778749126.89565222577278; Tue, 15 Oct 2019 08:36:18 -0700 (PDT) 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 F3D01801685; Tue, 15 Oct 2019 15:36: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 C5EFB5D71C; Tue, 15 Oct 2019 15:36: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 7690024F30; Tue, 15 Oct 2019 15:36:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZIJr024769 for ; Tue, 15 Oct 2019 11:35:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C15219C58; Tue, 15 Oct 2019 15:35:18 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D316219C5B for ; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id CCC2F101CE9; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:35:04 +0200 Message-Id: <43fa9d2a15323503c84fe5360278a0f58934115c.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 28/31] qemuxml2*test: Add test cases for default CPU models on ppc64 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: , 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.6.2 (mx1.redhat.com [10.5.110.67]); Tue, 15 Oct 2019 15:36:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - new patch ...ault-cpu-kvm-pseries-2.7.ppc64-latest.args | 38 ++++++++++++++++ .../ppc64-default-cpu-kvm-pseries-2.7.xml | 22 +++++++++ ...ault-cpu-kvm-pseries-3.1.ppc64-latest.args | 38 ++++++++++++++++ .../ppc64-default-cpu-kvm-pseries-3.1.xml | 22 +++++++++ ...ault-cpu-kvm-pseries-4.2.ppc64-latest.args | 38 ++++++++++++++++ .../ppc64-default-cpu-kvm-pseries-4.2.xml | 22 +++++++++ ...ault-cpu-tcg-pseries-2.7.ppc64-latest.args | 38 ++++++++++++++++ .../ppc64-default-cpu-tcg-pseries-2.7.xml | 22 +++++++++ ...ault-cpu-tcg-pseries-3.1.ppc64-latest.args | 38 ++++++++++++++++ .../ppc64-default-cpu-tcg-pseries-3.1.xml | 22 +++++++++ ...ault-cpu-tcg-pseries-4.2.ppc64-latest.args | 38 ++++++++++++++++ .../ppc64-default-cpu-tcg-pseries-4.2.xml | 22 +++++++++ tests/qemuxml2argvtest.c | 6 +++ ...fault-cpu-kvm-pseries-2.7.ppc64-latest.xml | 45 +++++++++++++++++++ ...fault-cpu-kvm-pseries-3.1.ppc64-latest.xml | 45 +++++++++++++++++++ ...fault-cpu-kvm-pseries-4.2.ppc64-latest.xml | 45 +++++++++++++++++++ ...fault-cpu-tcg-pseries-2.7.ppc64-latest.xml | 45 +++++++++++++++++++ ...fault-cpu-tcg-pseries-3.1.ppc64-latest.xml | 45 +++++++++++++++++++ ...fault-cpu-tcg-pseries-4.2.ppc64-latest.xml | 45 +++++++++++++++++++ tests/qemuxml2xmltest.c | 6 +++ 20 files changed, 642 insertions(+) create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-2.= 7.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-2.= 7.xml create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-3.= 1.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-3.= 1.xml create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-4.= 2.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-4.= 2.xml create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.= 7.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.= 7.xml create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.= 1.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.= 1.xml create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.= 2.ppc64-latest.args create mode 100644 tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.= 2.xml create mode 100644 tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-= 2.7.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-= 3.1.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-= 4.2.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-= 2.7.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-= 3.1.ppc64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-= 4.2.ppc64-latest.xml diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-2.7.ppc64= -latest.args b/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-2.7.ppc= 64-latest.args new file mode 100644 index 0000000000..d264659d49 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-2.7.ppc64-latest= .args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pseries-2.7,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device pci-ohci,id=3Dusb,bus=3Dpci.0,addr=3D0x1 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-chardev pty,id=3Dcharserial0 \ +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-2.7.xml b= /tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-2.7.xml new file mode 100644 index 0000000000..9aac1815c4 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-2.7.xml @@ -0,0 +1,22 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-3.1.ppc64= -latest.args b/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-3.1.ppc= 64-latest.args new file mode 100644 index 0000000000..88f3b4ba26 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-3.1.ppc64-latest= .args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pseries-3.1,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device pci-ohci,id=3Dusb,bus=3Dpci.0,addr=3D0x1 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-chardev pty,id=3Dcharserial0 \ +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-3.1.xml b= /tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-3.1.xml new file mode 100644 index 0000000000..820b5bdf1c --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-3.1.xml @@ -0,0 +1,22 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-4.2.ppc64= -latest.args b/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-4.2.ppc= 64-latest.args new file mode 100644 index 0000000000..ea27f424cb --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-4.2.ppc64-latest= .args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pseries-4.2,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device pci-ohci,id=3Dusb,bus=3Dpci.0,addr=3D0x1 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-chardev pty,id=3Dcharserial0 \ +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-4.2.xml b= /tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-4.2.xml new file mode 100644 index 0000000000..df89d1c1be --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-kvm-pseries-4.2.xml @@ -0,0 +1,22 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.7.ppc64= -latest.args b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.7.ppc= 64-latest.args new file mode 100644 index 0000000000..c97fa531ae --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.7.ppc64-latest= .args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pseries-2.7,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device pci-ohci,id=3Dusb,bus=3Dpci.0,addr=3D0x1 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-chardev pty,id=3Dcharserial0 \ +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.7.xml b= /tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.7.xml new file mode 100644 index 0000000000..3e873becc6 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.7.xml @@ -0,0 +1,22 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.1.ppc64= -latest.args b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.1.ppc= 64-latest.args new file mode 100644 index 0000000000..fbad53b0fb --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.1.ppc64-latest= .args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pseries-3.1,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device pci-ohci,id=3Dusb,bus=3Dpci.0,addr=3D0x1 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-chardev pty,id=3Dcharserial0 \ +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.1.xml b= /tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.1.xml new file mode 100644 index 0000000000..747de38584 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.1.xml @@ -0,0 +1,22 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.2.ppc64= -latest.args b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.2.ppc= 64-latest.args new file mode 100644 index 0000000000..4222d4d4aa --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.2.ppc64-latest= .args @@ -0,0 +1,38 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-ppc64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pseries-4.2,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device pci-ohci,id=3Dusb,bus=3Dpci.0,addr=3D0x1 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-chardev pty,id=3Dcharserial0 \ +-device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D0x30000000 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.2.xml b= /tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.2.xml new file mode 100644 index 0000000000..1e2fef3313 --- /dev/null +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.2.xml @@ -0,0 +1,22 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + /usr/bin/qemu-system-ppc64 + + + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index b88518b2ff..7fb84fc950 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3036,6 +3036,12 @@ mymain(void) =20 DO_TEST_CAPS_ARCH_LATEST("aarch64-default-cpu-kvm-virt-4.2", "aarch64"= ); DO_TEST_CAPS_ARCH_LATEST("aarch64-default-cpu-tcg-virt-4.2", "aarch64"= ); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-kvm-pseries-2.7", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-2.7", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-kvm-pseries-3.1", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-3.1", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-kvm-pseries-4.2", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-4.2", "ppc64"); =20 if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); diff --git a/tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-2.7.ppc= 64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-2.7.= ppc64-latest.xml new file mode 100644 index 0000000000..d0bff449c1 --- /dev/null +++ b/tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-2.7.ppc64-late= st.xml @@ -0,0 +1,45 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + + + + +
+ + +
+ + + + + + + + + +
+ + + +
+ + +
+ + + + diff --git a/tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-3.1.ppc= 64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-3.1.= ppc64-latest.xml new file mode 100644 index 0000000000..add48334e7 --- /dev/null +++ b/tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-3.1.ppc64-late= st.xml @@ -0,0 +1,45 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + + + + +
+ + +
+ + + + + + + + + +
+ + + +
+ + +
+ + + + diff --git a/tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-4.2.ppc= 64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-4.2.= ppc64-latest.xml new file mode 100644 index 0000000000..9c02766b71 --- /dev/null +++ b/tests/qemuxml2xmloutdata/ppc64-default-cpu-kvm-pseries-4.2.ppc64-late= st.xml @@ -0,0 +1,45 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + + + + +
+ + +
+ + + + + + + + + +
+ + + +
+ + +
+ + + + diff --git a/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-2.7.ppc= 64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-2.7.= ppc64-latest.xml new file mode 100644 index 0000000000..fc1714a17e --- /dev/null +++ b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-2.7.ppc64-late= st.xml @@ -0,0 +1,45 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + + + + +
+ + +
+ + + + + + + + + +
+ + + +
+ + +
+ + + + diff --git a/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-3.1.ppc= 64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-3.1.= ppc64-latest.xml new file mode 100644 index 0000000000..f40f3be155 --- /dev/null +++ b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-3.1.ppc64-late= st.xml @@ -0,0 +1,45 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + + + + +
+ + +
+ + + + + + + + + +
+ + + +
+ + +
+ + + + diff --git a/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-4.2.ppc= 64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-4.2.= ppc64-latest.xml new file mode 100644 index 0000000000..9582223550 --- /dev/null +++ b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-4.2.ppc64-late= st.xml @@ -0,0 +1,45 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + + + + +
+ + +
+ + + + + + + + + +
+ + + +
+ + +
+ + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index fee5dc66a1..9b23bdbd75 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1342,6 +1342,12 @@ mymain(void) =20 DO_TEST_CAPS_ARCH_LATEST("aarch64-default-cpu-kvm-virt-4.2", "aarch64"= ); DO_TEST_CAPS_ARCH_LATEST("aarch64-default-cpu-tcg-virt-4.2", "aarch64"= ); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-kvm-pseries-2.7", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-2.7", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-kvm-pseries-3.1", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-3.1", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-kvm-pseries-4.2", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-4.2", "ppc64"); =20 if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153852; cv=none; d=zoho.com; s=zohoarc; b=KjiY9NdKr4U3hxqxIZh5X8XZRCtQaPkrlgzwJOQ7H7tOVjs7OrHW4GazRFRTc5WeKHBmrHyx24N5b0lT0APajn4eKO+7MK1u3GzNQP5xdWATmHzM1cNxzeGWElQIDxXlf2DkD5Nb3M9ZxBqIrp2DeCNr/t2KO8VNVpL+bOwoWgE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153852; 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=wxi1zhFtsy0VVy0oovTCWFB6B98qTbiuPg4ACKtkIN0=; b=blpALM1fyyN7p8Dgp3Hga6YptiXGU0Amq/5ngAY3Y2iVvtFipE0qTotPrZsQc2ZM9TwckQs8LJBt4D7oog2OFU8lPB3IqjXhaGof/k+c/H+dIHeESy73dZwN8tteCsorZ8oD7EWcjNKrjjtnObb/GFVp7f9W3ubrJf4plBcq+c8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153852605644.7927066750345; Tue, 15 Oct 2019 08:37:32 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 0E7FE210D; Tue, 15 Oct 2019 15:37:31 +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 13BF4F6EE; Tue, 15 Oct 2019 15:37:28 +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 8B95B180B761; Tue, 15 Oct 2019 15:37:28 +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 x9FFZI3f024750 for ; Tue, 15 Oct 2019 11:35:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 291275C1D6; Tue, 15 Oct 2019 15:35:18 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC05E5C1D4 for ; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id D3857101CEA; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:35:05 +0200 Message-Id: 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 v2 29/31] qemuxml2*test: Add test cases for default CPU models on s390x 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Tue, 15 Oct 2019 15:37:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - new patch ...t-cpu-kvm-ccw-virtio-4.2.s390x-latest.args | 31 +++++++++++++++++++ .../s390-default-cpu-kvm-ccw-virtio-4.2.xml | 16 ++++++++++ ...t-cpu-tcg-ccw-virtio-4.2.s390x-latest.args | 31 +++++++++++++++++++ .../s390-default-cpu-tcg-ccw-virtio-4.2.xml | 16 ++++++++++ tests/qemuxml2argvtest.c | 2 ++ ...lt-cpu-kvm-ccw-virtio-4.2.s390x-latest.xml | 23 ++++++++++++++ ...lt-cpu-tcg-ccw-virtio-4.2.s390x-latest.xml | 23 ++++++++++++++ tests/qemuxml2xmltest.c | 2 ++ 8 files changed, 144 insertions(+) create mode 100644 tests/qemuxml2argvdata/s390-default-cpu-kvm-ccw-virtio-= 4.2.s390x-latest.args create mode 100644 tests/qemuxml2argvdata/s390-default-cpu-kvm-ccw-virtio-= 4.2.xml create mode 100644 tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-= 4.2.s390x-latest.args create mode 100644 tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-= 4.2.xml create mode 100644 tests/qemuxml2xmloutdata/s390-default-cpu-kvm-ccw-virti= o-4.2.s390x-latest.xml create mode 100644 tests/qemuxml2xmloutdata/s390-default-cpu-tcg-ccw-virti= o-4.2.s390x-latest.xml diff --git a/tests/qemuxml2argvdata/s390-default-cpu-kvm-ccw-virtio-4.2.s39= 0x-latest.args b/tests/qemuxml2argvdata/s390-default-cpu-kvm-ccw-virtio-4.2= .s390x-latest.args new file mode 100644 index 0000000000..d45a87e6ec --- /dev/null +++ b/tests/qemuxml2argvdata/s390-default-cpu-kvm-ccw-virtio-4.2.s390x-late= st.args @@ -0,0 +1,31 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-test/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-test/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-test/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-s390x \ +-name guest=3Dtest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-test/master-key.aes \ +-machine s390-ccw-virtio-4.2,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 256 \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device virtio-balloon-ccw,id=3Dballoon0,devno=3Dfe.0.0000 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/s390-default-cpu-kvm-ccw-virtio-4.2.xml= b/tests/qemuxml2argvdata/s390-default-cpu-kvm-ccw-virtio-4.2.xml new file mode 100644 index 0000000000..405b53db7d --- /dev/null +++ b/tests/qemuxml2argvdata/s390-default-cpu-kvm-ccw-virtio-4.2.xml @@ -0,0 +1,16 @@ + + test + 9aa4b45c-b9dd-45ef-91fe-862b27b4231f + 262144 + 262144 + + hvm + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + diff --git a/tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-4.2.s39= 0x-latest.args b/tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-4.2= .s390x-latest.args new file mode 100644 index 0000000000..3d31148613 --- /dev/null +++ b/tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-4.2.s390x-late= st.args @@ -0,0 +1,31 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-test/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-test/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-test/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-s390x \ +-name guest=3Dtest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-test/master-key.aes \ +-machine s390-ccw-virtio-4.2,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 256 \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid 9aa4b45c-b9dd-45ef-91fe-862b27b4231f \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device virtio-balloon-ccw,id=3Dballoon0,devno=3Dfe.0.0000 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-4.2.xml= b/tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-4.2.xml new file mode 100644 index 0000000000..c6c92bb08a --- /dev/null +++ b/tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-4.2.xml @@ -0,0 +1,16 @@ + + test + 9aa4b45c-b9dd-45ef-91fe-862b27b4231f + 262144 + 262144 + + hvm + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 7fb84fc950..e19f30ff15 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3042,6 +3042,8 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-3.1", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-kvm-pseries-4.2", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-4.2", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-kvm-ccw-virtio-4.2", "s390x= "); + DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-tcg-ccw-virtio-4.2", "s390x= "); =20 if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); diff --git a/tests/qemuxml2xmloutdata/s390-default-cpu-kvm-ccw-virtio-4.2.s= 390x-latest.xml b/tests/qemuxml2xmloutdata/s390-default-cpu-kvm-ccw-virtio-= 4.2.s390x-latest.xml new file mode 100644 index 0000000000..b35de63ab3 --- /dev/null +++ b/tests/qemuxml2xmloutdata/s390-default-cpu-kvm-ccw-virtio-4.2.s390x-la= test.xml @@ -0,0 +1,23 @@ + + test + 9aa4b45c-b9dd-45ef-91fe-862b27b4231f + 262144 + 262144 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + +
+ + + + diff --git a/tests/qemuxml2xmloutdata/s390-default-cpu-tcg-ccw-virtio-4.2.s= 390x-latest.xml b/tests/qemuxml2xmloutdata/s390-default-cpu-tcg-ccw-virtio-= 4.2.s390x-latest.xml new file mode 100644 index 0000000000..55149d4a78 --- /dev/null +++ b/tests/qemuxml2xmloutdata/s390-default-cpu-tcg-ccw-virtio-4.2.s390x-la= test.xml @@ -0,0 +1,23 @@ + + test + 9aa4b45c-b9dd-45ef-91fe-862b27b4231f + 262144 + 262144 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + +
+ + + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 9b23bdbd75..19650c424f 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1348,6 +1348,8 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-3.1", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-kvm-pseries-4.2", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-4.2", "ppc64"); + DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-kvm-ccw-virtio-4.2", "s390x= "); + DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-tcg-ccw-virtio-4.2", "s390x= "); =20 if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153854; cv=none; d=zoho.com; s=zohoarc; b=j4Zf597OLkJpQ3UINr5EjHzJziSo7LFLjLNU9emQ5aYbKJx/ynMmD87L+DmP/99K1Kk/FRVMyynJd8UvtAa/XWwMvJJFVXoTCOwfvEZneELYlxjNcswuKk+OEKfTNAFDSH+h//AaYbhjdmQnhwCPP8H942RZ5TIu1+CHAYR/4yY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153854; 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=05Bk8bSDiGLADlgjXorvLBc3g7cMnCKsulV26Op9k7o=; b=ZDmBHy0WGjW9jigTi0UKvhT2gBb2QJlmUOkSmt8R3z+1aLurfSiniPN44ajRWwPpKPnkJgevQNboet4ZdHG4fNB+WE4lxtMeDgvLbfVGPZsyutNrRHTLqQu/Vk97+KKnr1wo+sDm9FkdCX5UyXkzpSJP+hK6g5OQvE+nKqDXad4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153854370347.0499165578698; Tue, 15 Oct 2019 08:37:34 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id AAB9410C094E; Tue, 15 Oct 2019 15:37:32 +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 6308E45AE; Tue, 15 Oct 2019 15:37:32 +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 230F7149F6; Tue, 15 Oct 2019 15:37:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9FFZI35024764 for ; Tue, 15 Oct 2019 11:35:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 568AA10027AB; Tue, 15 Oct 2019 15:35:18 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D381910018F8 for ; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id DB145101CEB; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:35:06 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 30/31] qemuxml2*test: Add test cases for default CPU models on x86_64 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Tue, 15 Oct 2019 15:37:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - new patch ...-default-cpu-kvm-pc-4.2.x86_64-latest.args | 36 +++++++++++ .../x86_64-default-cpu-kvm-pc-4.2.xml | 24 ++++++++ ...default-cpu-kvm-q35-4.2.x86_64-latest.args | 41 +++++++++++++ .../x86_64-default-cpu-kvm-q35-4.2.xml | 24 ++++++++ ...-default-cpu-tcg-pc-4.2.x86_64-latest.args | 36 +++++++++++ .../x86_64-default-cpu-tcg-pc-4.2.xml | 24 ++++++++ ...default-cpu-tcg-q35-4.2.x86_64-latest.args | 41 +++++++++++++ .../x86_64-default-cpu-tcg-q35-4.2.xml | 24 ++++++++ tests/qemuxml2argvtest.c | 4 ++ ...4-default-cpu-kvm-pc-4.2.x86_64-latest.xml | 37 ++++++++++++ ...-default-cpu-kvm-q35-4.2.x86_64-latest.xml | 60 +++++++++++++++++++ ...4-default-cpu-tcg-pc-4.2.x86_64-latest.xml | 37 ++++++++++++ ...-default-cpu-tcg-q35-4.2.x86_64-latest.xml | 60 +++++++++++++++++++ tests/qemuxml2xmltest.c | 4 ++ 14 files changed, 452 insertions(+) create mode 100644 tests/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.x8= 6_64-latest.args create mode 100644 tests/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.xml create mode 100644 tests/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.x= 86_64-latest.args create mode 100644 tests/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.x= ml create mode 100644 tests/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.x8= 6_64-latest.args create mode 100644 tests/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.xml create mode 100644 tests/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.x= 86_64-latest.args create mode 100644 tests/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.x= ml create mode 100644 tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-pc-4.2.= x86_64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-q35-4.2= .x86_64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-pc-4.2.= x86_64-latest.xml create mode 100644 tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-q35-4.2= .x86_64-latest.xml diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-la= test.args b/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-lat= est.args new file mode 100644 index 0000000000..c7bef11f22 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-latest.ar= gs @@ -0,0 +1,36 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pc-i440fx-4.2,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.xml b/tes= ts/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.xml new file mode 100644 index 0000000000..ce432ef52f --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.xml @@ -0,0 +1,24 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + /usr/bin/qemu-system-x86_64 + + + + + + + diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.x86_64-l= atest.args b/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.x86_64-l= atest.args new file mode 100644 index 0000000000..c65d29fc32 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.x86_64-latest.a= rgs @@ -0,0 +1,41 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pc-q35-4.2,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device pcie-root-port,port=3D0x8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,mult= ifunction=3Don,\ +addr=3D0x1 \ +-device pcie-root-port,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ +-device pcie-root-port,port=3D0xa,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr= =3D0x1.0x2 \ +-device pcie-root-port,port=3D0xb,chassis=3D4,id=3Dpci.4,bus=3Dpcie.0,addr= =3D0x1.0x3 \ +-device qemu-xhci,id=3Dusb,bus=3Dpci.1,addr=3D0x0 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.2,addr=3D0x0,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.3,addr=3D0x0 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.xml b/te= sts/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.xml new file mode 100644 index 0000000000..bf2678e674 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.xml @@ -0,0 +1,24 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + /usr/bin/qemu-system-x86_64 + + + + + + + diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-la= test.args b/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-lat= est.args new file mode 100644 index 0000000000..1c233243ad --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-latest.ar= gs @@ -0,0 +1,36 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pc-i440fx-4.2,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device piix3-usb-uhci,id=3Dusb,bus=3Dpci.0,addr=3D0x1.0x2 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.xml b/tes= ts/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.xml new file mode 100644 index 0000000000..8e77a3ad92 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.xml @@ -0,0 +1,24 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + /usr/bin/qemu-system-x86_64 + + + + + + + diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.x86_64-l= atest.args b/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.x86_64-l= atest.args new file mode 100644 index 0000000000..505eeb44b3 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.x86_64-latest.a= rgs @@ -0,0 +1,41 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-guest \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-guest/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-guest/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-guest/.config \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3Dguest,debug-threads=3Don \ +-S \ +-object secret,id=3DmasterKey0,format=3Draw,\ +file=3D/tmp/lib/domain--1-guest/master-key.aes \ +-machine pc-q35-4.2,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-m 4096 \ +-overcommit mem-lock=3Doff \ +-smp 4,sockets=3D4,cores=3D1,threads=3D1 \ +-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device pcie-root-port,port=3D0x8,chassis=3D1,id=3Dpci.1,bus=3Dpcie.0,mult= ifunction=3Don,\ +addr=3D0x1 \ +-device pcie-root-port,port=3D0x9,chassis=3D2,id=3Dpci.2,bus=3Dpcie.0,addr= =3D0x1.0x1 \ +-device pcie-root-port,port=3D0xa,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr= =3D0x1.0x2 \ +-device pcie-root-port,port=3D0xb,chassis=3D4,id=3Dpci.4,bus=3Dpcie.0,addr= =3D0x1.0x3 \ +-device qemu-xhci,id=3Dusb,bus=3Dpci.1,addr=3D0x0 \ +-drive file=3D/var/lib/libvirt/images/guest.qcow2,format=3Dqcow2,if=3Dnone= ,\ +id=3Ddrive-virtio-disk0 \ +-device virtio-blk-pci,scsi=3Doff,bus=3Dpci.2,addr=3D0x0,drive=3Ddrive-vir= tio-disk0,\ +id=3Dvirtio-disk0,bootindex=3D1 \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.3,addr=3D0x0 \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ +resourcecontrol=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.xml b/te= sts/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.xml new file mode 100644 index 0000000000..4e3b341800 --- /dev/null +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.xml @@ -0,0 +1,24 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + + /usr/bin/qemu-system-x86_64 + + + + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index e19f30ff15..8d60a30678 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3044,6 +3044,10 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-4.2", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-kvm-ccw-virtio-4.2", "s390x= "); DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-tcg-ccw-virtio-4.2", "s390x= "); + DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-kvm-pc-4.2", "x86_64"); + DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-tcg-pc-4.2", "x86_64"); + DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-kvm-q35-4.2", "x86_64"); + DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-tcg-q35-4.2", "x86_64"); =20 if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); diff --git a/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-= latest.xml b/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-= latest.xml new file mode 100644 index 0000000000..1f24dee8e7 --- /dev/null +++ b/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-latest.= xml @@ -0,0 +1,37 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-q35-4.2.x86_64= -latest.xml b/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-q35-4.2.x86_6= 4-latest.xml new file mode 100644 index 0000000000..39a7013b67 --- /dev/null +++ b/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-q35-4.2.x86_64-latest= .xml @@ -0,0 +1,60 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + +
+ + +
+ + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + diff --git a/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-= latest.xml b/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-= latest.xml new file mode 100644 index 0000000000..b45ad4c051 --- /dev/null +++ b/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-latest.= xml @@ -0,0 +1,37 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-q35-4.2.x86_64= -latest.xml b/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-q35-4.2.x86_6= 4-latest.xml new file mode 100644 index 0000000000..c6a85977e9 --- /dev/null +++ b/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-q35-4.2.x86_64-latest= .xml @@ -0,0 +1,60 @@ + + guest + 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + 4194304 + 4194304 + 4 + + hvm + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + +
+ + +
+ + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 19650c424f..ab6399b683 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1350,6 +1350,10 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("ppc64-default-cpu-tcg-pseries-4.2", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-kvm-ccw-virtio-4.2", "s390x= "); DO_TEST_CAPS_ARCH_LATEST("s390-default-cpu-tcg-ccw-virtio-4.2", "s390x= "); + DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-kvm-pc-4.2", "x86_64"); + DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-tcg-pc-4.2", "x86_64"); + DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-kvm-q35-4.2", "x86_64"); + DO_TEST_CAPS_ARCH_LATEST("x86_64-default-cpu-tcg-q35-4.2", "x86_64"); =20 if (getenv("LIBVIRT_SKIP_CLEANUP") =3D=3D NULL) virFileDeleteTree(fakerootdir); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 19:22:50 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; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1571153858; cv=none; d=zoho.com; s=zohoarc; b=Y4XXp8tUoP7eoywg3RG8NPpmhH3Leq+6n7jzVabBQXJXn7IiS+Fuo3jNG35hUHmCNvkeHwTj+zIjIVN29P90Hdcjkp9UgMiASwRey+/HCDAujVvt5UDX6dJig3ccZzitAVmTD+ycg6ZijV2r/iuT4CwKeI5xm3OTBaFHiG1cqj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571153858; 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=+KRGDMR/jYvH9l0DEVd8S8K5xaMzch0cHtOxBOaKjzw=; b=nGkqyTUhlLZWWM8eosEurlnSr6CfcKFD+wo6950tKf/tv6Yv2TC+s7Q4k6CVDLHdRPSK8b43SoXAXu2HeE4vgTv9N1orA4qU7c5YRG08rlkQyn4lUFVCo27QO3BbeZ5gKwWMqKxz77YCQcR2EmtKnqY8r28jYBf3Qu3rkrsst5w= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1571153858096824.3993209010818; Tue, 15 Oct 2019 08:37:38 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 3D9CC10C093C; Tue, 15 Oct 2019 15:37:36 +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 1BBFB19C58; Tue, 15 Oct 2019 15:37:36 +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 CE38E149F9; Tue, 15 Oct 2019 15:37:35 +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 x9FFZI7W024774 for ; Tue, 15 Oct 2019 11:35:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C7DD60127; Tue, 15 Oct 2019 15:35:18 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E153D6013A for ; Tue, 15 Oct 2019 15:35:17 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id E2C2A101CEC; Tue, 15 Oct 2019 17:35:09 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 15 Oct 2019 17:35:07 +0200 Message-Id: <9c4329a06fbc90fb6fc3683cf18f1224efcb2bf9.1571152057.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 31/31] qemu: Store default CPU in domain XML 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Tue, 15 Oct 2019 15:37:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When starting a domain without a CPU model specified in the domain XML, QEMU will choose a default one. Which is fine unless the domain gets migrated to another host because libvirt doesn't perform any CPU ABI checks and the virtual CPU provided by QEMU on the destination host can differ from the one on the source host. With QEMU 4.2.0 we can probe for the default CPU model used by QEMU for a particular machine type and store it in the domain XML. This way the chosen CPU model is more visible to users and libvirt will make sure the guest will see the exact same CPU after migration. Architecture specific notes - aarch64: We only set the default CPU for TCG domains as KVM requires -cpu host to work. - ppc64: (to be checked with QEMU developers) Default CPU data reported by QEMU is unusable for KVM. QEMU would effectively use -cpu host by default and it even rewrites typename of the current host CPU model to host-powerpc64-cpu. The default CPU type reported by query-machines is still power*-powerpc64-cpu, which may not even exist due to the changed typename. For example, on a Power8 host, power8 CPU model is of host-powerpc64-cpu type (according to query-cpu-definitions), while the default CPU type name for pseries-3.1 machine type is reported as power8_v2.0-powerpc64-cpu. What's even worse, pseries-4.2 says the default CPU type is power9_v2.0-powerpc64-cpu, which cannot be started on older host at all. So again, we only set the default CPU for TCG domains. - s390x: (to be checked with QEMU developers) The default CPU is said to be "qemu", which works fine for TCG domains, but it doesn't work on KVM because QEMU complains that some features requested in the CPU model are not available. - x86_64: The default CPU model (qemu64) is not runnable on any host with KVM, but in contrast to s390x QEMU just disables unavailable features and starts happily. https://bugzilla.redhat.com/show_bug.cgi?id=3D1598151 https://bugzilla.redhat.com/show_bug.cgi?id=3D1598162 --- Notes: This patch should not be merged yet as we need to confirm what to do on s390x and ppc64 architectures. =20 Version 2: - new test cases src/qemu/qemu_domain.c | 56 +++++++++++++++++++ ...fault-cpu-tcg-virt-4.2.aarch64-latest.args | 1 + .../disk-cache.x86_64-latest.args | 1 + .../disk-cdrom-network.x86_64-latest.args | 1 + .../disk-cdrom-tray.x86_64-latest.args | 1 + .../disk-copy_on_read.x86_64-latest.args | 1 + .../disk-detect-zeroes.x86_64-latest.args | 1 + .../disk-floppy-q35-2_11.x86_64-latest.args | 1 + .../disk-floppy-q35-2_9.x86_64-latest.args | 1 + .../os-firmware-bios.x86_64-latest.args | 1 + ...os-firmware-efi-secboot.x86_64-latest.args | 1 + .../os-firmware-efi.x86_64-latest.args | 1 + ...ault-cpu-tcg-pseries-2.7.ppc64-latest.args | 1 + ...ault-cpu-tcg-pseries-3.1.ppc64-latest.args | 1 + ...ault-cpu-tcg-pseries-4.2.ppc64-latest.args | 1 + ...t-cpu-tcg-ccw-virtio-4.2.s390x-latest.args | 1 + .../tpm-emulator-tpm2-enc.x86_64-latest.args | 1 + .../tpm-emulator-tpm2.x86_64-latest.args | 1 + .../tpm-emulator.x86_64-latest.args | 1 + .../tseg-explicit-size.x86_64-latest.args | 1 + .../vhost-vsock-auto.x86_64-latest.args | 1 + .../vhost-vsock.x86_64-latest.args | 1 + ...-default-cpu-kvm-pc-4.2.x86_64-latest.args | 1 + ...default-cpu-kvm-q35-4.2.x86_64-latest.args | 1 + ...-default-cpu-tcg-pc-4.2.x86_64-latest.args | 1 + ...default-cpu-tcg-q35-4.2.x86_64-latest.args | 1 + ...efault-cpu-tcg-virt-4.2.aarch64-latest.xml | 3 + .../os-firmware-bios.x86_64-latest.xml | 3 + .../os-firmware-efi-secboot.x86_64-latest.xml | 3 + .../os-firmware-efi.x86_64-latest.xml | 3 + ...fault-cpu-tcg-pseries-2.7.ppc64-latest.xml | 3 + ...fault-cpu-tcg-pseries-3.1.ppc64-latest.xml | 3 + ...fault-cpu-tcg-pseries-4.2.ppc64-latest.xml | 3 + ...lt-cpu-tcg-ccw-virtio-4.2.s390x-latest.xml | 3 + .../tpm-emulator-tpm2-enc.x86_64-latest.xml | 3 + .../tpm-emulator-tpm2.x86_64-latest.xml | 3 + .../tpm-emulator.x86_64-latest.xml | 3 + .../tpm-passthrough-crb.x86_64-latest.xml | 3 + .../tpm-passthrough.x86_64-latest.xml | 3 + ...4-default-cpu-kvm-pc-4.2.x86_64-latest.xml | 3 + ...-default-cpu-kvm-q35-4.2.x86_64-latest.xml | 3 + ...4-default-cpu-tcg-pc-4.2.x86_64-latest.xml | 3 + ...-default-cpu-tcg-q35-4.2.x86_64-latest.xml | 3 + 43 files changed, 132 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 9dcba4ef38..438f003186 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4470,6 +4470,59 @@ qemuDomainDefVcpusPostParse(virDomainDefPtr def) } =20 =20 +static int +qemuDomainDefSetDefaultCPU(virDomainDefPtr def, + virQEMUCapsPtr qemuCaps) +{ + VIR_AUTOPTR(virCPUDef) newCPU =3D NULL; + virCPUDefPtr cpu =3D def->cpu; + const char *model; + + if (cpu && + (cpu->mode !=3D VIR_CPU_MODE_CUSTOM || + cpu->model)) + return 0; + + /* Default CPU model info from QEMU is usable for TCG only on non-Intel + * architectures. */ + if (!ARCH_IS_X86(def->os.arch) && def->virtType !=3D VIR_DOMAIN_VIRT_Q= EMU) + return 0; + + model =3D virQEMUCapsGetMachineDefaultCPU(qemuCaps, def->os.machine, d= ef->virtType); + if (!model) { + VIR_DEBUG("Unknown default CPU model for domain '%s'", def->name); + return 0; + } + + VIR_DEBUG("Setting default CPU model for domain '%s' to %s", + def->name, model); + + if (!cpu) { + if (VIR_ALLOC(newCPU) < 0) + return -1; + cpu =3D newCPU; + } + + /* We need to turn off all CPU checks when the domain is started becau= se + * the default CPU (e.g., qemu64) may not be runnable on any host. QEMU + * will just disable the unavailable features and we will update the C= PU + * definition accordingly and set check to FULL when starting the doma= in. */ + cpu->type =3D VIR_CPU_TYPE_GUEST; + cpu->mode =3D VIR_CPU_MODE_CUSTOM; + cpu->match =3D VIR_CPU_MATCH_EXACT; + cpu->check =3D VIR_CPU_CHECK_NONE; + cpu->fallback =3D VIR_CPU_FALLBACK_FORBID; + + if (VIR_STRDUP(cpu->model, model) < 0) + return -1; + + if (newCPU) + VIR_STEAL_PTR(def->cpu, newCPU); + + return 0; +} + + static int qemuDomainDefCPUPostParse(virDomainDefPtr def) { @@ -4644,6 +4697,9 @@ qemuDomainDefPostParse(virDomainDefPtr def, if (qemuCanonicalizeMachine(def, qemuCaps) < 0) return -1; =20 + if (qemuDomainDefSetDefaultCPU(def, qemuCaps) < 0) + return -1; + qemuDomainDefEnableDefaultFeatures(def, qemuCaps); =20 if (qemuDomainRecheckInternalPaths(def, cfg, parseFlags) < 0) diff --git a/tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2.aarch6= 4-latest.args b/tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2.aar= ch64-latest.args index 5ecbe1fdd6..5305c23464 100644 --- a/tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2.aarch64-lates= t.args +++ b/tests/qemuxml2argvdata/aarch64-default-cpu-tcg-virt-4.2.aarch64-lates= t.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-guest/master-key.aes \ -machine virt-4.2,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,gic-version= =3D2 \ +-cpu cortex-a15 \ -m 4096 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args b/tests/q= emuxml2argvdata/disk-cache.x86_64-latest.args index 7ea6d5b4d5..01d3b9d490 100644 --- a/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -machine pc-i440fx-2.6,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 214 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args b= /tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args index cf711c0a3f..e0d2eb049d 100644 --- a/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -machine pc-1.2,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args b/te= sts/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args index ad17416851..21542db4c2 100644 --- a/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine pc-0.13,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args b/= tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args index 1f1d37c957..8552f9f00e 100644 --- a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine pc-0.13,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args b= /tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args index b48c0f8d43..2a01647e50 100644 --- a/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine pc-0.13,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args= b/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args index 02e2b1e76c..fadd5a6d7e 100644 --- a/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-floppy-q35-2_11.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -machine pc-q35-2.11,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 214 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args = b/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args index a158e8e3d3..4c932a7365 100644 --- a/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-floppy-q35-2_9.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -machine pc-q35-2.9,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 214 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/os-firmware-bios.x86_64-latest.args b/t= ests/qemuxml2argvdata/os-firmware-bios.x86_64-latest.args index 7d6108ec24..4391c6eda2 100644 --- a/tests/qemuxml2argvdata/os-firmware-bios.x86_64-latest.args +++ b/tests/qemuxml2argvdata/os-firmware-bios.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-fedora/master-key.aes \ -machine pc-q35-4.0,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -bios /usr/share/seabios/bios-256k.bin \ -m 8 \ -overcommit mem-lock=3Doff \ diff --git a/tests/qemuxml2argvdata/os-firmware-efi-secboot.x86_64-latest.a= rgs b/tests/qemuxml2argvdata/os-firmware-efi-secboot.x86_64-latest.args index d8f356ea07..4de135beb8 100644 --- a/tests/qemuxml2argvdata/os-firmware-efi-secboot.x86_64-latest.args +++ b/tests/qemuxml2argvdata/os-firmware-efi-secboot.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-fedora/master-key.aes \ -machine pc-q35-4.0,accel=3Dkvm,usb=3Doff,smm=3Don,dump-guest-core=3Doff \ +-cpu qemu64 \ -global driver=3Dcfi.pflash01,property=3Dsecure,value=3Don \ -drive file=3D/usr/share/OVMF/OVMF_CODE.secboot.fd,if=3Dpflash,format=3Dra= w,unit=3D0,\ readonly=3Don \ diff --git a/tests/qemuxml2argvdata/os-firmware-efi.x86_64-latest.args b/te= sts/qemuxml2argvdata/os-firmware-efi.x86_64-latest.args index e4dda734b0..7eba20e443 100644 --- a/tests/qemuxml2argvdata/os-firmware-efi.x86_64-latest.args +++ b/tests/qemuxml2argvdata/os-firmware-efi.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-fedora/master-key.aes \ -machine pc-q35-4.0,accel=3Dkvm,usb=3Doff,smm=3Don,dump-guest-core=3Doff \ +-cpu qemu64 \ -drive file=3D/usr/share/OVMF/OVMF_CODE.secboot.fd,if=3Dpflash,format=3Dra= w,unit=3D0,\ readonly=3Don \ -drive file=3D/var/lib/libvirt/qemu/nvram/fedora_VARS.fd,if=3Dpflash,forma= t=3Draw,\ diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.7.ppc64= -latest.args b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.7.ppc= 64-latest.args index c97fa531ae..06946dcbd9 100644 --- a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.7.ppc64-latest= .args +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-2.7.ppc64-latest= .args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-guest/master-key.aes \ -machine pseries-2.7,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu POWER7 \ -m 4096 \ -overcommit mem-lock=3Doff \ -smp 4,sockets=3D4,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.1.ppc64= -latest.args b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.1.ppc= 64-latest.args index fbad53b0fb..6090a1bbad 100644 --- a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.1.ppc64-latest= .args +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-3.1.ppc64-latest= .args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-guest/master-key.aes \ -machine pseries-3.1,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu POWER8 \ -m 4096 \ -overcommit mem-lock=3Doff \ -smp 4,sockets=3D4,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.2.ppc64= -latest.args b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.2.ppc= 64-latest.args index 4222d4d4aa..7804a7b220 100644 --- a/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.2.ppc64-latest= .args +++ b/tests/qemuxml2argvdata/ppc64-default-cpu-tcg-pseries-4.2.ppc64-latest= .args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-guest/master-key.aes \ -machine pseries-4.2,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu POWER9 \ -m 4096 \ -overcommit mem-lock=3Doff \ -smp 4,sockets=3D4,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-4.2.s39= 0x-latest.args b/tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-4.2= .s390x-latest.args index 3d31148613..c7bd0c3840 100644 --- a/tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-4.2.s390x-late= st.args +++ b/tests/qemuxml2argvdata/s390-default-cpu-tcg-ccw-virtio-4.2.s390x-late= st.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine s390-ccw-virtio-4.2,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu \ -m 256 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/tpm-emulator-tpm2-enc.x86_64-latest.arg= s b/tests/qemuxml2argvdata/tpm-emulator-tpm2-enc.x86_64-latest.args index 3c8dc8e483..2455e14cfe 100644 --- a/tests/qemuxml2argvdata/tpm-emulator-tpm2-enc.x86_64-latest.args +++ b/tests/qemuxml2argvdata/tpm-emulator-tpm2-enc.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-TPM-VM/master-key.aes \ -machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 2048 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/tpm-emulator-tpm2.x86_64-latest.args b/= tests/qemuxml2argvdata/tpm-emulator-tpm2.x86_64-latest.args index 3c8dc8e483..2455e14cfe 100644 --- a/tests/qemuxml2argvdata/tpm-emulator-tpm2.x86_64-latest.args +++ b/tests/qemuxml2argvdata/tpm-emulator-tpm2.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-TPM-VM/master-key.aes \ -machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 2048 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/tpm-emulator.x86_64-latest.args b/tests= /qemuxml2argvdata/tpm-emulator.x86_64-latest.args index 3c8dc8e483..2455e14cfe 100644 --- a/tests/qemuxml2argvdata/tpm-emulator.x86_64-latest.args +++ b/tests/qemuxml2argvdata/tpm-emulator.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-TPM-VM/master-key.aes \ -machine pc-i440fx-2.12,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 2048 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/tseg-explicit-size.x86_64-latest.args b= /tests/qemuxml2argvdata/tseg-explicit-size.x86_64-latest.args index 2fece310e7..53dab283cc 100644 --- a/tests/qemuxml2argvdata/tseg-explicit-size.x86_64-latest.args +++ b/tests/qemuxml2argvdata/tseg-explicit-size.x86_64-latest.args @@ -14,6 +14,7 @@ QEMU_AUDIO_DRV=3Dnone \ file=3D/tmp/lib/domain--1-QEMUGuest1/master-key.aes \ -machine pc-q35-2.10,accel=3Dtcg,usb=3Doff,smm=3Don,dump-guest-core=3Doff \ -global mch.extended-tseg-mbytes=3D48 \ +-cpu qemu64 \ -m 214 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/vhost-vsock-auto.x86_64-latest.args b/t= ests/qemuxml2argvdata/vhost-vsock-auto.x86_64-latest.args index b5d3ff2204..e083b872c5 100644 --- a/tests/qemuxml2argvdata/vhost-vsock-auto.x86_64-latest.args +++ b/tests/qemuxml2argvdata/vhost-vsock-auto.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine pc-i440fx-2.9,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/vhost-vsock.x86_64-latest.args b/tests/= qemuxml2argvdata/vhost-vsock.x86_64-latest.args index 76df9d2d4d..1b0ffee6e8 100644 --- a/tests/qemuxml2argvdata/vhost-vsock.x86_64-latest.args +++ b/tests/qemuxml2argvdata/vhost-vsock.x86_64-latest.args @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-test/master-key.aes \ -machine pc-0.13,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 1024 \ -overcommit mem-lock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-la= test.args b/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-lat= est.args index c7bef11f22..7a335bc0c4 100644 --- a/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-latest.ar= gs +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-latest.ar= gs @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-guest/master-key.aes \ -machine pc-i440fx-4.2,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 4096 \ -overcommit mem-lock=3Doff \ -smp 4,sockets=3D4,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.x86_64-l= atest.args b/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.x86_64-l= atest.args index c65d29fc32..88a634fc68 100644 --- a/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.x86_64-latest.a= rgs +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-kvm-q35-4.2.x86_64-latest.a= rgs @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-guest/master-key.aes \ -machine pc-q35-4.2,accel=3Dkvm,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 4096 \ -overcommit mem-lock=3Doff \ -smp 4,sockets=3D4,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-la= test.args b/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-lat= est.args index 1c233243ad..5f11a07a19 100644 --- a/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-latest.ar= gs +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-latest.ar= gs @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-guest/master-key.aes \ -machine pc-i440fx-4.2,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 4096 \ -overcommit mem-lock=3Doff \ -smp 4,sockets=3D4,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.x86_64-l= atest.args b/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.x86_64-l= atest.args index 505eeb44b3..1c9330f720 100644 --- a/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.x86_64-latest.a= rgs +++ b/tests/qemuxml2argvdata/x86_64-default-cpu-tcg-q35-4.2.x86_64-latest.a= rgs @@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3DmasterKey0,format=3Draw,\ file=3D/tmp/lib/domain--1-guest/master-key.aes \ -machine pc-q35-4.2,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff \ +-cpu qemu64 \ -m 4096 \ -overcommit mem-lock=3Doff \ -smp 4,sockets=3D4,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2xmloutdata/aarch64-default-cpu-tcg-virt-4.2.aarc= h64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-default-cpu-tcg-virt-4.2.= aarch64-latest.xml index 1f4104857a..c0aa2f39ee 100644 --- a/tests/qemuxml2xmloutdata/aarch64-default-cpu-tcg-virt-4.2.aarch64-lat= est.xml +++ b/tests/qemuxml2xmloutdata/aarch64-default-cpu-tcg-virt-4.2.aarch64-lat= est.xml @@ -11,6 +11,9 @@ + + cortex-a15 + destroy restart diff --git a/tests/qemuxml2xmloutdata/os-firmware-bios.x86_64-latest.xml b/= tests/qemuxml2xmloutdata/os-firmware-bios.x86_64-latest.xml index 63886666dd..60d3498765 100644 --- a/tests/qemuxml2xmloutdata/os-firmware-bios.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/os-firmware-bios.x86_64-latest.xml @@ -16,6 +16,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/os-firmware-efi-secboot.x86_64-latest= .xml b/tests/qemuxml2xmloutdata/os-firmware-efi-secboot.x86_64-latest.xml index a285e06334..938da73711 100644 --- a/tests/qemuxml2xmloutdata/os-firmware-efi-secboot.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/os-firmware-efi-secboot.x86_64-latest.xml @@ -16,6 +16,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/os-firmware-efi.x86_64-latest.xml b/t= ests/qemuxml2xmloutdata/os-firmware-efi.x86_64-latest.xml index 46a7b1b780..97ce8a75c7 100644 --- a/tests/qemuxml2xmloutdata/os-firmware-efi.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/os-firmware-efi.x86_64-latest.xml @@ -16,6 +16,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-2.7.ppc= 64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-2.7.= ppc64-latest.xml index fc1714a17e..e76766ff5a 100644 --- a/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-2.7.ppc64-late= st.xml +++ b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-2.7.ppc64-late= st.xml @@ -8,6 +8,9 @@ hvm + + POWER7 + destroy restart diff --git a/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-3.1.ppc= 64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-3.1.= ppc64-latest.xml index f40f3be155..c1d619a9cb 100644 --- a/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-3.1.ppc64-late= st.xml +++ b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-3.1.ppc64-late= st.xml @@ -8,6 +8,9 @@ hvm + + POWER8 + destroy restart diff --git a/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-4.2.ppc= 64-latest.xml b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-4.2.= ppc64-latest.xml index 9582223550..311a7ad9da 100644 --- a/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-4.2.ppc64-late= st.xml +++ b/tests/qemuxml2xmloutdata/ppc64-default-cpu-tcg-pseries-4.2.ppc64-late= st.xml @@ -8,6 +8,9 @@ hvm + + POWER9 + destroy restart diff --git a/tests/qemuxml2xmloutdata/s390-default-cpu-tcg-ccw-virtio-4.2.s= 390x-latest.xml b/tests/qemuxml2xmloutdata/s390-default-cpu-tcg-ccw-virtio-= 4.2.s390x-latest.xml index 55149d4a78..8ccd460d01 100644 --- a/tests/qemuxml2xmloutdata/s390-default-cpu-tcg-ccw-virtio-4.2.s390x-la= test.xml +++ b/tests/qemuxml2xmloutdata/s390-default-cpu-tcg-ccw-virtio-4.2.s390x-la= test.xml @@ -8,6 +8,9 @@ hvm + + qemu + destroy restart diff --git a/tests/qemuxml2xmloutdata/tpm-emulator-tpm2-enc.x86_64-latest.x= ml b/tests/qemuxml2xmloutdata/tpm-emulator-tpm2-enc.x86_64-latest.xml index dcd504310f..8a842e4d22 100644 --- a/tests/qemuxml2xmloutdata/tpm-emulator-tpm2-enc.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/tpm-emulator-tpm2-enc.x86_64-latest.xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/tpm-emulator-tpm2.x86_64-latest.xml b= /tests/qemuxml2xmloutdata/tpm-emulator-tpm2.x86_64-latest.xml index 625aaa5f60..9143a1dde1 100644 --- a/tests/qemuxml2xmloutdata/tpm-emulator-tpm2.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/tpm-emulator-tpm2.x86_64-latest.xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/tpm-emulator.x86_64-latest.xml b/test= s/qemuxml2xmloutdata/tpm-emulator.x86_64-latest.xml index 002af76c21..ff4006b2e3 100644 --- a/tests/qemuxml2xmloutdata/tpm-emulator.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/tpm-emulator.x86_64-latest.xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/tpm-passthrough-crb.x86_64-latest.xml= b/tests/qemuxml2xmloutdata/tpm-passthrough-crb.x86_64-latest.xml index ef68c2d0d7..b8be67acfd 100644 --- a/tests/qemuxml2xmloutdata/tpm-passthrough-crb.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/tpm-passthrough-crb.x86_64-latest.xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml b/t= ests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml index 2a99f35cf8..669992bcf6 100644 --- a/tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/tpm-passthrough.x86_64-latest.xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-= latest.xml b/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-= latest.xml index 1f24dee8e7..c7b0f11cf8 100644 --- a/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-latest.= xml +++ b/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-pc-4.2.x86_64-latest.= xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-q35-4.2.x86_64= -latest.xml b/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-q35-4.2.x86_6= 4-latest.xml index 39a7013b67..be211acd29 100644 --- a/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-q35-4.2.x86_64-latest= .xml +++ b/tests/qemuxml2xmloutdata/x86_64-default-cpu-kvm-q35-4.2.x86_64-latest= .xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-= latest.xml b/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-= latest.xml index b45ad4c051..159270b83a 100644 --- a/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-latest.= xml +++ b/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-pc-4.2.x86_64-latest.= xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart diff --git a/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-q35-4.2.x86_64= -latest.xml b/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-q35-4.2.x86_6= 4-latest.xml index c6a85977e9..b95e146c81 100644 --- a/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-q35-4.2.x86_64-latest= .xml +++ b/tests/qemuxml2xmloutdata/x86_64-default-cpu-tcg-q35-4.2.x86_64-latest= .xml @@ -12,6 +12,9 @@ + + qemu64 + destroy restart --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list