]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: add support for timer period audio setting
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 3 Jun 2021 08:15:19 +0000 (09:15 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 4 Jun 2021 11:07:46 +0000 (12:07 +0100)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
docs/formatdomain.rst
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/conf/domain_conf.h

index aa7bb8da14c8045b264cd55f304d8a7b9075eddb..afee69ac97d67e87d89e01461414e571400d0b24 100644 (file)
@@ -6924,6 +6924,10 @@ to the guest sound device.
 ``id``
    Integer id of the audio device. Must be greater than 0.
 
+``timerPeriod``
+   Timer period in microseconds. Must be greater than 0. If omitted,
+   the lowest possible period is used.
+
 All the backends support child element for configuring input and
 output properties
 
@@ -6931,7 +6935,7 @@ output properties
 
    ...
    <devices>
-     <audio id='1' type='pulseaudio'>
+     <audio id='1' type='pulseaudio' timerPeriod='40'>
        <input mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'>
          <settings frequency='44100' channels='2' format='s16'/>
        </input>
index 38f9d3f5997a1534236622bc2d3262bae237e578..233805cb66fc1e6256e85b3f06e78f77466476e0 100644 (file)
       <attribute name="id">
         <ref name="uint8"/>
       </attribute>
+      <optional>
+        <attribute name="timerPeriod">
+          <ref name="uint32"/>
+        </attribute>
+      </optional>
       <choice>
         <group>
           <attribute name="type">
index f424ed731fd6f1d48f7a0a1d85205b4afcaf0afc..7b9de2e92d1d0803042578ccf8272673e44d4b61 100644 (file)
@@ -13193,6 +13193,10 @@ virDomainAudioDefParseXML(virDomainXMLOption *xmlopt G_GNUC_UNUSED,
                        &def->id) < 0)
         goto error;
 
+    if (virXMLPropUInt(node, "timerPeriod", 10, VIR_XML_PROP_NONZERO,
+                       &def->timerPeriod) < 0)
+        goto error;
+
     inputNode = virXPathNode("./input", ctxt);
     outputNode = virXPathNode("./output", ctxt);
 
@@ -25461,6 +25465,9 @@ virDomainAudioDefFormat(virBuffer *buf,
 
     virBufferAsprintf(buf, "<audio id='%d' type='%s'", def->id, type);
 
+    if (def->timerPeriod)
+        virBufferAsprintf(buf, " timerPeriod='%u'", def->timerPeriod);
+
     switch (def->type) {
     case VIR_DOMAIN_AUDIO_TYPE_NONE:
         break;
index 99f18c13bcfb8a4324a2dd11762115e384d012ec..f706c498ff017579611bf6b59de69b46276a828d 100644 (file)
@@ -1559,6 +1559,8 @@ struct _virDomainAudioDef {
 
     unsigned int id;
 
+    unsigned int timerPeriod;
+
     virDomainAudioIOCommon input;
     virDomainAudioIOCommon output;
     union {