]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Add virtio-related options to filesystems
authorJán Tomko <jtomko@redhat.com>
Mon, 6 Jun 2016 14:50:57 +0000 (16:50 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 8 Jun 2017 14:32:40 +0000 (16:32 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=1283251

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/conf/domain_conf.h
tests/qemuxml2argvdata/qemuxml2argv-virtio-options.xml

index 77242f0339164ee3802e3897f1957e25e8ee8ba5..efd7a5fcc2564f2c96a3c376b47f921348f1b65b 100644 (file)
             or "handle", but no formats. Virtuozzo driver supports
             a type of "ploop" with a format of "ploop".
           </li>
+          <li>
+          For virtio-backed devices,
+          <a href="#elementsVirtio">Virtio-specific options</a> can also be
+          set. (<span class="since">Since 3.5.0</span>)
+          </li>
         </ul>
       </dd>
 
index 1d4639227df7eb79e93e9060a8b3155ff849a490..8ff553d3fd292c57030a1a04f252038905c2fe30 100644 (file)
           <value>immediate</value>
         </attribute>
       </optional>
+      <ref name='virtioOptions'/>
       <empty/>
     </element>
   </define>
index a3c06c95b5ff3eb15e50004175cc76f44db96e73..9c71c8a3962280acd8c7d07d0a64f5d5352217e1 100644 (file)
@@ -1918,6 +1918,7 @@ void virDomainFSDefFree(virDomainFSDefPtr def)
     virStorageSourceFree(def->src);
     VIR_FREE(def->dst);
     virDomainDeviceInfoClear(&def->info);
+    VIR_FREE(def->virtio);
 
     VIR_FREE(def);
 }
@@ -9478,6 +9479,9 @@ virDomainFSDefParseXML(xmlNodePtr node,
             goto error;
     }
 
+    if (virDomainVirtioOptionsParseXML(ctxt, &def->virtio) < 0)
+        goto error;
+
     def->src->path = source;
     source = NULL;
     def->dst = target;
@@ -19272,6 +19276,10 @@ virDomainFsDefCheckABIStability(virDomainFSDefPtr src,
         return false;
     }
 
+    if (src->virtio && dst->virtio &&
+        !virDomainVirtioOptionsCheckABIStability(src->virtio, dst->virtio))
+        return false;
+
     if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info))
         return false;
 
@@ -21757,6 +21765,8 @@ virDomainFSDefFormat(virBufferPtr buf,
 
     }
 
+    virDomainVirtioOptionsFormat(&driverBuf, def->virtio);
+
     if (virBufferUse(&driverBuf)) {
         virBufferAddLit(buf, "<driver");
         virBufferAddBuffer(buf, &driverBuf);
index 9795767ac498f44919367fb65c646ad1fe701810..acb6748f7bc91fad5bd9b6fd4967f566f78929a3 100644 (file)
@@ -876,6 +876,7 @@ struct _virDomainFSDef {
     unsigned long long space_hard_limit; /* in bytes */
     unsigned long long space_soft_limit; /* in bytes */
     bool symlinksResolved;
+    virDomainVirtioOptionsPtr virtio;
 };
 
 
index 867e56c107492d9d9bad36b9bb9c15c86018b437..33da21461157d920a25bd9729933e9455823c1dd 100644 (file)
       <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
     </controller>
     <filesystem type='mount' accessmode='passthrough'>
+      <driver iommu='on' ats='on'/>
       <source dir='/export/fs1'/>
       <target dir='fs1'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
     </filesystem>
     <filesystem type='mount' accessmode='mapped'>
-      <driver type='path' wrpolicy='immediate'/>
+      <driver type='path' wrpolicy='immediate' iommu='on' ats='on'/>
       <source dir='/export/fs2'/>
       <target dir='fs2'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>