[libvirt] [PATCH 3/4] domain_conf: Add support for iothreads in disk definition

John Ferlan jferlan at redhat.com
Tue Aug 26 10:45:46 UTC 2014



On 08/26/2014 01:03 AM, Martin Kletzander wrote:
> On Mon, Aug 25, 2014 at 08:38:08PM -0400, John Ferlan wrote:
>> Add a new disk "driver" attribute "iothread" to be parsed as the thread
>> number for the disk to use. In order to more easily facilitate the usage
>> and configuration of the iothread, a "zero" for the attribute indicates
>> iothreads are not supported for the device and a positive value indicates
>> the specific thread to try and use.
>>
>> Signed-off-by: John Ferlan <jferlan at redhat.com>
>> ---
>> docs/formatdomain.html.in     |  8 ++++++++
>> docs/schemas/domaincommon.rng | 13 +++++++++++++
>> src/conf/domain_conf.c        | 24 +++++++++++++++++++++++-
>> src/conf/domain_conf.h        |  2 ++
>> 4 files changed, 46 insertions(+), 1 deletion(-)
>>
>> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
>> index b4ac483..40891e4 100644
>> --- a/docs/schemas/domaincommon.rng
>> +++ b/docs/schemas/domaincommon.rng
>> @@ -1572,6 +1572,9 @@
>>       <optional>
>>         <ref name="discard"/>
>>       </optional>
>> +      <optional>
>> +        <ref name="driverIOThread"/>
>> +      </optional>
>>       <empty/>
>>     </element>
>>   </define>
>> @@ -1659,6 +1662,11 @@
>>       </choice>
>>     </attribute>
>>   </define>
>> +  <define name="driverIOThread">
>> +    <attribute name='iothread'>
>> +      <ref name="iothreadsid"/>
> 
> Again, what's the difference to just ref name="unsignedInt"?
> 

See .1 response...  I'll change it.

>> +    </attribute>
>> +  </define>
>>   <define name="controller">
>>     <element name="controller">
>>       <attribute name="index">
>> @@ -4759,6 +4767,11 @@
>>       <param name="minInclusive">0</param>
>>     </data>
>>   </define>
>> +  <define name="iothreadsid">
>> +    <data type="unsignedInt">
>> +      <param name="pattern">[0-9]+</param>
>> +    </data>
>> +  </define>
>>   <define name="vcpuid">
>>     <data type="unsignedShort">
>>       <param name="pattern">[0-9]+</param>
>> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>> index 671c41c..b15f279 100644
>> --- a/src/conf/domain_conf.c
>> +++ b/src/conf/domain_conf.c
> [...]
>> @@ -11968,6 +11980,14 @@ virDomainDefParseXML(xmlDocPtr xml,
>>             goto error;
>>         }
>>         def->iothreads = count;
>> +
>> +        /* Create a bitmap for inuse threads - noting that entries are
>> +         * numbered 1..def->iothreads since 0 (zero) iothreads means
>> +         * nothing and assigning a disk to an IOThread requires at least a
>> +         * thread# > 0 since a zero would indicate no IOThread for the disk
>> +         */
>> +        if (!(def->iothreadmap = virBitmapNew(def->iothreads+1)))
>> +            goto error;
> 
> virBitmapFree(def->iothreadmap) is missing in virDomainDefFree().
> 

Hmm.. good catch - now it *was* there in one of my buffers at some point
in time.  I *know* I typed it!

John




More information about the libvir-list mailing list