[libvirt] [PATCH 7/6] virtio-rng: Add rate limiting options for virtio-RNG

Peter Krempa pkrempa at redhat.com
Tue Feb 19 13:39:46 UTC 2013


On 02/19/13 14:21, John Ferlan wrote:
> On 02/13/2013 11:28 AM, Peter Krempa wrote:
>> Qemu's implementation of virtio RNG supports rate limiting of the
>> entropy used. This patch exposes the option to tune this fucntionality.
>
> s/fucntionality/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>
>>    ...
>> ---
>>   docs/formatdomain.html.in                              |  9 +++++++++
>>   docs/schemas/domaincommon.rng                          | 18 +++++++++++++++++-
>>   src/conf/domain_conf.c                                 | 17 +++++++++++++++++
>>   src/conf/domain_conf.h                                 |  2 ++
>>   src/qemu/qemu_command.c                                |  8 ++++++++
>>   .../qemuxml2argv-virtio-rng-random.args                |  2 +-
>>   .../qemuxml2argv-virtio-rng-random.xml                 |  1 +
>>   7 files changed, 55 insertions(+), 2 deletions(-)
>>
>> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
>> index e8cd086..b264460 100644
>> --- a/docs/formatdomain.html.in
>> +++ b/docs/formatdomain.html.in
>> @@ -4293,6 +4293,7 @@ qemu-kvm -net nic,model=? /dev/null
>>     ...
>>     <devices>
>>       <rng model='virtio'>
>> +      <rate period="2000">1234</rate>
>>         <backend model='random'>/dev/random</backend>
>>         <!-- OR -->
>>         <backend model='egd' type='udp'>
>> @@ -4315,6 +4316,14 @@ 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 rate parameter allows to limit the rate that the entropy can be
>> +          read from the source. The value is in bits that the device is allowed
>> +          to read in the selected period. The default period is 1000ms or 1 second.
>> +        </p>
>> +      </dd>
>
> bits or bytes?
>

qemu uses bits for it's configuration value. As the expected data rades 
are pretty low, I think bits can be used and potentially divided to 
larger values if needed.

Peter




More information about the libvir-list mailing list