From patchwork Thu Apr 4 23:37:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 161817 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2204437jan; Thu, 4 Apr 2019 16:38:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwySP+FOEhKr40a1IsdZ57lHU63tn5wPBe2CkHcES1UQA/Cdw+hoLbcLxzIFwVXhiq9mTDr X-Received: by 2002:a0c:ad15:: with SMTP id u21mr7682448qvc.37.1554421100908; Thu, 04 Apr 2019 16:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554421100; cv=none; d=google.com; s=arc-20160816; b=U0oKpodpCNNca8ORKSj6YD8SIgIIh4usvcBhi7JSjSZLGLJKKV8NBTMMFwMapkF/el LqXnqU+qG/Gv0+Hr6T0Kfe9TvznAYHplKTY+XqJp7IYG4EDo0dxCgQd6qb/y37orHdU3 QKr7ZBky1EpRNEvuBZbnVVMvaLLFkeXtd3RVj0vGSuR3bgKCvTmMOZ7R4bB6HfsSQMy3 ibMQXuPdFVz5nCAAN9igXkUDghRdzD/yfo3tioADHucxEhz/AZOstJOcUq6fEG5Bhw5u 7p6LReHPQzivfNVai9LIm2b8Gz/1DbHxoxFqURUcTz1Zp29wwHIZeIXfKHCZB2Mk8cTa nWVA== 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=/VVQYH5Pow+1vkG6B8Dt68vRa+JQEDQRnks+CTawWXs=; b=SsZRb49bO8mlaRpU8CWC42FL1X5wkbqjfsF7sLYtsOkbDT7iXMc0m3tYr6HEVUiCPG qPpEpEo7uSwotrDfiajF5vfVLG+pG71czUYQ7BX7/u2mZBku5ZpZD8gJZeiA7wdXkjO5 qDiVL1B+OdtDJ2AnCxswLRKz+BTAeOIezE48SVSJhBcqJg7pgDGfUb5VQFGuX6sTsKPZ 0etnC3uJmE1EYHQjEBMlv1ZhVzTWS7JxlUUwov7FVNwaqoxv1McJIex5WKo0ehYNOtr/ rG3DbOqOkuFLv0ezFj35SjWEm9TUB3KWKvWS30V/kFJrirw3d1Fi3NwGvZUTz2ckQbUi PCzw== 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 z31si1402162qvc.171.2019.04.04.16.38.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Apr 2019 16:38:20 -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-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 6457B30832CB; Thu, 4 Apr 2019 23:38:19 +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 3C48C1001E99; Thu, 4 Apr 2019 23:38:19 +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 064053FB13; Thu, 4 Apr 2019 23:38:19 +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 x34NbcaK011007 for ; Thu, 4 Apr 2019 19:37:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 95E0B6091F; Thu, 4 Apr 2019 23:37:38 +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 C125C608E5; Thu, 4 Apr 2019 23:37:37 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 4 Apr 2019 19:37:21 -0400 Message-Id: <6160973443b95d23525f6e557151f0bd97dd0c44.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 1/7] conf: domcaps: Report device X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 04 Apr 2019 23:38:19 +0000 (UTC) This adds device reporting. Example output: virtio virtio-transitional virtio-non-transitional random egd Signed-off-by: Cole Robinson --- docs/formatdomaincaps.html.in | 35 ++++++++++++++++++++++++++++++++++ docs/schemas/domaincaps.rng | 10 ++++++++++ src/conf/domain_capabilities.c | 14 ++++++++++++++ src/conf/domain_capabilities.h | 9 +++++++++ 4 files changed, 68 insertions(+) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in index 2583f9bead..22ddab4301 100644 --- a/docs/formatdomaincaps.html.in +++ b/docs/formatdomaincaps.html.in @@ -427,6 +427,41 @@ element. + +

RNG device

+

RNG device capabilities are exposed under the + rng element. For instance:

+ +
+<domainCapabilities>
+  ...
+  <devices>
+    <rng supported='yes'>
+      <enum name='model'>
+        <value>virtio</value>
+        <value>virtio-transitional</value>
+        <value>virtio-non-transitional</value>
+      </enum>
+      <enum name='backendModel'>
+        <value>random</value>
+        <value>egd</value>
+      </enum>
+    </rng>
+    ...
+  </devices>
+</domainCapabilities>
+
+ +
+
model
+
Options for the model attribute of the + <rng> element.
+
backendModel
+
Options for the model attribute of the + <rng><backend> element.
+
+ +

Features

One more set of XML elements describe the supported features and diff --git a/docs/schemas/domaincaps.rng b/docs/schemas/domaincaps.rng index 3c42cb8075..d1b4d930d9 100644 --- a/docs/schemas/domaincaps.rng +++ b/docs/schemas/domaincaps.rng @@ -154,6 +154,9 @@ + + + @@ -185,6 +188,13 @@ + + + + + + + diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 5a8f48da61..03757ba8cd 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -543,6 +543,19 @@ virDomainCapsDeviceHostdevFormat(virBufferPtr buf, } +static void +virDomainCapsDeviceRNGFormat(virBufferPtr buf, + virDomainCapsDeviceRNGPtr const rng) +{ + FORMAT_PROLOGUE(rng); + + ENUM_PROCESS(rng, model, virDomainRNGModelTypeToString); + ENUM_PROCESS(rng, backendModel, virDomainRNGBackendTypeToString); + + FORMAT_EPILOGUE(rng); +} + + /** * virDomainCapsFeatureGICFormat: * @buf: target buffer @@ -621,6 +634,7 @@ virDomainCapsFormat(virDomainCapsPtr const caps) virDomainCapsDeviceGraphicsFormat(&buf, &caps->graphics); virDomainCapsDeviceVideoFormat(&buf, &caps->video); virDomainCapsDeviceHostdevFormat(&buf, &caps->hostdev); + virDomainCapsDeviceRNGFormat(&buf, &caps->rng); virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "\n"); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 26f4b8c394..052191d284 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -96,6 +96,14 @@ struct _virDomainCapsDeviceHostdev { /* add new fields here */ }; +typedef struct _virDomainCapsDeviceRNG virDomainCapsDeviceRNG; +typedef virDomainCapsDeviceRNG *virDomainCapsDeviceRNGPtr; +struct _virDomainCapsDeviceRNG { + virTristateBool supported; + virDomainCapsEnum model; /* virDomainRNGModel */ + virDomainCapsEnum backendModel; /* virDomainRNGBackend */ +}; + typedef struct _virDomainCapsFeatureGIC virDomainCapsFeatureGIC; typedef virDomainCapsFeatureGIC *virDomainCapsFeatureGICPtr; struct _virDomainCapsFeatureGIC { @@ -165,6 +173,7 @@ struct _virDomainCaps { virDomainCapsDeviceGraphics graphics; virDomainCapsDeviceVideo video; virDomainCapsDeviceHostdev hostdev; + virDomainCapsDeviceRNG rng; /* add new domain devices here */ virDomainCapsFeatureGIC gic;