From patchwork Thu Apr 4 23:37:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 161818 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2204484jan; Thu, 4 Apr 2019 16:38:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmtfn5JvbXJai5d23oo/FqdDKuuqcVYHfMlOvyh5CfnO96dyq13/6lQ5glu3lb1c9x5Qs0 X-Received: by 2002:ac8:3844:: with SMTP id r4mr8213767qtb.5.1554421104156; Thu, 04 Apr 2019 16:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554421104; cv=none; d=google.com; s=arc-20160816; b=bolxnmzNWz7X0BjCVu9NzMv9MBQzD6U3nggxCOfeDzL0ozP7hbY40PpsOZF0dMaAG6 MnmHTztbNL7eX/94on5TCP0+789JyL/3MuWuYUI4iE4fa1XkX8P8+wkRReCECWcfKbVj HdRs1EhTygmwW4WE5o03e0NUWBtNBX1Z1o4Y5FokLG6B1jX/Iy7IwYFxZNfmWs/IKdza YGQ5CtxCXDaaG9kjKch43iAWx3VhDeXvTBG2/eMWEFLIKLg8lAxZWq+vgAYPuvnRoI0e kjyXP/4VdY3/uBy/MQVzuUeDd7fvjwBOvJ069o0WN4uX6zktTQSnxtESeHwuaVzsTTqo /IEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=18/MfqM02VfZ0+FbIBXKrSulWsh4+3TdW19lRYW+Y1o=; b=uoO+DaIT8mLU9XVqhcqCWTs4UqRAvU+1SKHBC2PPny/lQxvP6p00SfRR5VKpPcHmQK lsKxGvC6Q4E39NTSah03s03FkVz4u6JYq/IpLLDZLIivZpfn0ZC6Hml00q3eMHHLzEXC WgO3iX6bbyX5APFKa6UnezEdCrMpAYCY5W4iphouBZuzGuAp0vfbEThGoEslTxLZDTKB 28bAaD6TMDzs34b/11qwIm/tK/zyJJGjmSoPqIXbZtCR0GfYZ53+TU4HEQhzieDjSq9j wfr2QU/ZFM4au8p1p9A3BC+NhAJMGpZtSFL2tGW8qIC9hpJNNle5nfwFlPu0SLfcx0UX mjjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id q10si6357871qtj.317.2019.04.04.16.38.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Apr 2019 16:38:24 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 8EA3481F01; Thu, 4 Apr 2019 23:38:22 +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 5F6ED6017E; Thu, 4 Apr 2019 23:38: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 241C03FB14; Thu, 4 Apr 2019 23:38:22 +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 x34NbeGP011020 for ; Thu, 4 Apr 2019 19:37:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0BD10608EE; Thu, 4 Apr 2019 23:37:40 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-22.rdu2.redhat.com [10.10.124.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01F526092D; Thu, 4 Apr 2019 23:37:38 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 4 Apr 2019 19:37:22 -0400 Message-Id: <13488456c6173b3d69b870a747372a2a6d5e3e6e.1554419814.git.crobinso@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 2/7] qemu: capabilities: fill in domcaps X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 04 Apr 2019 23:38:23 +0000 (UTC) The model logic is taken from qemuDomainRNGDefValidate Signed-off-by: Cole Robinson --- src/qemu/qemu_capabilities.c | 30 +++++++++++++++++++ .../qemu_1.7.0.x86_64.xml | 9 ++++++ .../qemu_2.12.0-virt.aarch64.xml | 11 +++++++ .../qemu_2.12.0.ppc64.xml | 11 +++++++ .../qemu_2.12.0.s390x.xml | 11 +++++++ .../qemu_2.12.0.x86_64.xml | 11 +++++++ .../qemu_2.6.0-virt.aarch64.xml | 11 +++++++ .../qemu_2.6.0.aarch64.xml | 11 +++++++ .../domaincapsschemadata/qemu_2.6.0.ppc64.xml | 11 +++++++ .../qemu_2.6.0.x86_64.xml | 11 +++++++ .../domaincapsschemadata/qemu_2.7.0.s390x.xml | 11 +++++++ .../qemu_2.8.0-tcg.x86_64.xml | 11 +++++++ .../domaincapsschemadata/qemu_2.8.0.s390x.xml | 11 +++++++ .../qemu_2.8.0.x86_64.xml | 11 +++++++ .../qemu_2.9.0-q35.x86_64.xml | 11 +++++++ .../qemu_2.9.0-tcg.x86_64.xml | 11 +++++++ .../qemu_2.9.0.x86_64.xml | 11 +++++++ .../domaincapsschemadata/qemu_3.0.0.s390x.xml | 11 +++++++ .../qemu_4.0.0.x86_64.xml | 11 +++++++ 19 files changed, 226 insertions(+) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Signed-off-by: Cole Robinson <crobinso@redhat.com> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 71d4c01296..46ba5e30b5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5165,6 +5165,34 @@ virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps, } +static int +virQEMUCapsFillDomainDeviceRNGCaps(virQEMUCapsPtr qemuCaps, + virDomainCapsDeviceRNGPtr rng) +{ + rng->supported = VIR_TRISTATE_BOOL_YES; + rng->model.report = true; + rng->backendModel.report = true; + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_RNG)) { + VIR_DOMAIN_CAPS_ENUM_SET(rng->model, VIR_DOMAIN_RNG_MODEL_VIRTIO); + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL) || + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY)) { + VIR_DOMAIN_CAPS_ENUM_SET(rng->model, + VIR_DOMAIN_RNG_MODEL_VIRTIO_TRANSITIONAL, + VIR_DOMAIN_RNG_MODEL_VIRTIO_NON_TRANSITIONAL); + } + } + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_EGD)) + VIR_DOMAIN_CAPS_ENUM_SET(rng->backendModel, VIR_DOMAIN_RNG_BACKEND_EGD); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_RNG_RANDOM)) + VIR_DOMAIN_CAPS_ENUM_SET(rng->backendModel, VIR_DOMAIN_RNG_BACKEND_RANDOM); + + return 0; +} + + /** * virQEMUCapsSupportsGICVersion: * @qemuCaps: QEMU capabilities @@ -5306,6 +5334,7 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, virDomainCapsDeviceHostdevPtr hostdev = &domCaps->hostdev; virDomainCapsDeviceGraphicsPtr graphics = &domCaps->graphics; virDomainCapsDeviceVideoPtr video = &domCaps->video; + virDomainCapsDeviceRNGPtr rng = &domCaps->rng; domCaps->maxvcpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, domCaps->machine); @@ -5332,6 +5361,7 @@ virQEMUCapsFillDomainCaps(virCapsPtr caps, virQEMUCapsFillDomainDeviceGraphicsCaps(qemuCaps, graphics) < 0 || virQEMUCapsFillDomainDeviceVideoCaps(qemuCaps, video) < 0 || virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev) < 0 || + virQEMUCapsFillDomainDeviceRNGCaps(qemuCaps, rng) < 0 || virQEMUCapsFillDomainFeatureGICCaps(qemuCaps, domCaps) < 0 || virQEMUCapsFillDomainFeatureSEVCaps(qemuCaps, domCaps) < 0) return -1; diff --git a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml index 497363bbe9..a9b0efdbdb 100644 --- a/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml @@ -109,6 +109,15 @@ vfio + + + virtio + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml index 7639df44c6..654ce1f538 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0-virt.aarch64.xml @@ -114,6 +114,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml index f10d361359..2ac32fcb3b 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.ppc64.xml @@ -80,6 +80,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml index 41a81ff02f..fa377d33a0 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.s390x.xml @@ -172,6 +172,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml index 5913e7fc63..712b83f443 100644 --- a/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.12.0.x86_64.xml @@ -142,6 +142,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml index 9ee801092e..26bd16788a 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0-virt.aarch64.xml @@ -111,6 +111,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml index 4dd0b52ed3..3aa5474e64 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml @@ -111,6 +111,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml index aa982d237e..cb179b34af 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.ppc64.xml @@ -84,6 +84,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml index 6aa3f52ee4..5a675e205f 100644 --- a/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml @@ -116,6 +116,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml index 8daa15ab9d..f601922d5e 100644 --- a/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.7.0.s390x.xml @@ -77,6 +77,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml index 081805aa4a..4d48e7d251 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml @@ -117,6 +117,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml index 62c51e4087..f18dc262b4 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml @@ -158,6 +158,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml index 1bb034aa4f..46d398949a 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml @@ -117,6 +117,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml index 67c6d5e77e..a7392c0929 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml @@ -125,6 +125,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml index 588ef08199..f94f805b81 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml @@ -149,6 +149,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml index 598937a971..b0039c8246 100644 --- a/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml @@ -126,6 +126,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml b/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml index 1d97f1f344..b33ff6a09d 100644 --- a/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_3.0.0.s390x.xml @@ -178,6 +178,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + + diff --git a/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml b/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml index df66be9e29..7596e414d6 100644 --- a/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml +++ b/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml @@ -143,6 +143,17 @@ vfio + + + virtio + virtio-transitional + virtio-non-transitional + + + random + egd + +