]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
conf: Adjust the iothreadsched expectations
authorJohn Ferlan <jferlan@redhat.com>
Tue, 21 Apr 2015 21:21:28 +0000 (17:21 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 27 Apr 2015 16:36:35 +0000 (12:36 -0400)
With iothreadid's allowing any 'id' value for an iothread_id, the
iothreadsched code needs a slight adjustment to allow for "any"
unsigned int value in order to create the bitmap of ids that will
have scheduler adjustments. Adjusted the doc description as well.

docs/formatdomain.html.in
src/conf/domain_conf.c
tests/qemuxml2argvdata/qemuxml2argv-cputune-iothreadsched-toomuch.xml

index 7af6bd7823a807b8de2aa94080e1bce50ac3685d..0767a2a077bdf06457e7409c0c0459deef773a8f 100644 (file)
         type (values <code>batch</code>, <code>idle</code>, <code>fifo</code>,
         <code>rr</code>) for particular vCPU/IOThread threads (based on
         <code>vcpus</code> and <code>iothreads</code>, leaving out
-        <code>vcpus</code>/<code>iothreads</code> sets the default).  For
-        real-time schedulers (<code>fifo</code>, <code>rr</code>), priority must
-        be specified as well (and is ignored for non-real-time ones). The value
-        range for the priority depends on the host kernel (usually 1-99).
+        <code>vcpus</code>/<code>iothreads</code> sets the default). Valid
+        <code>vcpus</code> values start at 0 through one less than the
+        number of vCPU's defined for the domain. Valid <code>iothreads</code>
+        values are described in the <code>iothreadids</code>
+        <a href="#elementsIOThreadsAllocation"><code>description</code></a>.
+        If no <code>iothreadids</code> are defined, then libvirt numbers
+        IOThreads from 1 to the number of <code>iothreads</code> available
+        for the domain. For real-time schedulers (<code>fifo</code>,
+        <code>rr</code>), priority must real-time schedulers
+        (<code>fifo</code>, <code>rr</code>), priority must be specified as
+        well (and is ignored for non-real-time ones). The value range
+        for the priority depends on the host kernel (usually 1-99).
         <span class="since">Since 1.2.13</span>
       </dd>
 
index 1abb702b6fd6dc2fda9c12286874e7c8c445695a..7da94bb5f3c0dbd35df3027721a6455f14412913 100644 (file)
@@ -14348,12 +14348,24 @@ virDomainDefParseXML(xmlDocPtr xml,
         def->cputune.niothreadsched = n;
 
         for (i = 0; i < def->cputune.niothreadsched; i++) {
+            ssize_t pos = -1;
+
             if (virDomainThreadSchedParse(nodes[i],
-                                          1, def->iothreads,
+                                          1, UINT_MAX,
                                           "iothreads",
                                           &def->cputune.iothreadsched[i]) < 0)
                 goto error;
 
+            while ((pos = virBitmapNextSetBit(def->cputune.iothreadsched[i].ids,
+                                              pos)) > -1) {
+                if (!virDomainIOThreadIDFind(def, pos)) {
+                    virReportError(VIR_ERR_XML_DETAIL, "%s",
+                                   _("iothreadsched attribute 'iothreads' "
+                                     "uses undefined iothread ids"));
+                    goto error;
+                }
+            }
+
             for (j = 0; j < i; j++) {
                 if (virBitmapOverlaps(def->cputune.iothreadsched[i].ids,
                                       def->cputune.iothreadsched[j].ids)) {
index 1540969a3b64b991a5c1d3a0f47f4eabf3d7d376..7cae303278de7cf01de492a86f787053b1ec7dec 100644 (file)
@@ -13,7 +13,8 @@
     <vcpupin vcpu='1' cpuset='1'/>
     <emulatorpin cpuset='1'/>
     <vcpusched vcpus='0-1' scheduler='fifo' priority='1'/>
-    <iothreadsched iothreads='2' scheduler='batch'/>
+    <iothreadsched iothreads='1' scheduler='batch'/>
+    <iothreadsched iothreads='2' scheduler='fifo' priority='1'/>
   </cputune>
   <os>
     <type arch='i686' machine='pc'>hvm</type>