[libvirt] [PATCHv4] virtio-rng: Add rate limiting options for virtio-RNG

Peter Krempa pkrempa at redhat.com
Wed Feb 27 10:48:13 UTC 2013


On 02/27/13 11:42, Peter Krempa wrote:
> Qemu's implementation of virtio RNG supports rate limiting of the
> entropy used. This patch exposes the option to tune this functionality.
> 
> This patch is based on qemu commit 904d6f588063fb5ad2b61998acdf1e73fb4
> 
> The rate limiting is exported in the XML as:
> <devices>
>    ...
>    <rng model='virtio'>
>      <rate period='1234'>4321</rate>
>      <backend model='random'/>
>    </rng>
>    ...
> ---
> 
> Notes:
>      Version 4:
>      - Reword docs
>      - state it is available since 1.0.4 as the tree is frozen and this was actually never acked before
>      Version 3:
>      - State the time unit in docs
>      Version 2:
>      - Qemu uses bytes/period, adapt the value according to that
> 
>   docs/formatdomain.html.in                              | 13 +++++++++++++
>   docs/schemas/domaincommon.rng                          | 18 +++++++++++++++++-
>   src/conf/domain_conf.c                                 | 17 +++++++++++++++++
>   src/conf/domain_conf.h                                 |  2 ++
>   src/qemu/qemu_command.c                                |  9 +++++++++
>   .../qemuxml2argv-virtio-rng-random.args                |  2 +-
>   .../qemuxml2argv-virtio-rng-random.xml                 |  1 +
>   7 files changed, 60 insertions(+), 2 deletions(-)
> 
> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> index 1835b39..1c6c73e 100644
> --- a/docs/formatdomain.html.in
> +++ b/docs/formatdomain.html.in
...
> @@ -4302,6 +4303,18 @@ qemu-kvm -net nic,model=? /dev/null
>             <li>'virtio' — supported by qemu and virtio-rng kernel module</li>
>           </ul>
>         </dd>
> +      <dt><code>rate</code></dt>
> +      <dd>
> +        <p>
> +          The optional <code>rate</code> element allows limiting the rate at
> +          which entropy can be consumed from the source.  An optional
> +          <code>period</code> attribute specifies the duration of a period in
> +          milliseconds; if omitted, the period is taken as 1000 milliseconds
> +          (1 second).  The element contents specify how many bits are permitted
> +          per period.  Drivers may enforce a minimum rate, and may round the
> +          rate down to a minimum granularity.
> +        </p>


I forgot to commit this hunk before sending out the patch:

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 1c6c73e..6248f83 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -4313,6 +4313,7 @@ qemu-kvm -net nic,model=? /dev/null
           (1 second).  The element contents specify how many bits are permitted
           per period.  Drivers may enforce a minimum rate, and may round the
           rate down to a minimum granularity.
+          <span class='since'>Since 1.0.4</span>
         </p>
       </dd>
       <dt><code>backend</code></dt>


> +      </dd>
>         <dt><code>backend</code></dt>
>         <dd>
>           <p>

Peter




More information about the libvir-list mailing list