<cookies>
<cookie name="test">somevalue</cookie>
</cookies>
+ <readahead size='65536'/>
+ <timeout seconds='6'/>
</source>
<target dev='hde' bus='ide' tray='open'/>
<readonly/>
must conform to the HTTP specification.
<span class="since">Since 6.2.0</span>
</dd>
+ <dt><code>readahead</code></dt>
+ <dd>
+ Specifies the size of the readahead buffer for protocols
+ which support it. (all 'curl' based drivers in qemu). The size
+ is in bytes. Note that '0' is considered as if the value is not
+ provided.
+ <span class="since">Since 6.2.0</span>
+ </dd>
+ <dt><code>timeout</code></dt>
+ <dd>
+ Specifies the connection timeout for protocols which support it.
+ Note that '0' is considered as if the value is not provided.
+ <span class="since">Since 6.2.0</span>
+ </dd>
</dl>
<p>
</element>
</define>
+ <define name="diskSourceNetworkProtocolPropsCommon">
+ <optional>
+ <element name="readahead">
+ <attribute name="size">
+ <ref name="positiveInteger"/>
+ </attribute>
+ <empty/>
+ </element>
+ </optional>
+ <optional>
+ <element name="timeout">
+ <attribute name="seconds">
+ <ref name="positiveInteger"/>
+ </attribute>
+ <empty/>
+ </element>
+ </optional>
+ </define>
+
<define name="diskSourceNetworkProtocolSSLVerify">
<element name="ssl">
<attribute name="verify">
<optional>
<ref name="diskSourceNetworkProtocolHTTPCookies"/>
</optional>
+ <ref name="diskSourceNetworkProtocolPropsCommon"/>
</element>
</define>
<optional>
<ref name="diskSourceNetworkProtocolHTTPCookies"/>
</optional>
+ <ref name="diskSourceNetworkProtocolPropsCommon"/>
</element>
</define>
<optional>
<ref name="diskSourceNetworkProtocolSSLVerify"/>
</optional>
+ <ref name="diskSourceNetworkProtocolPropsCommon"/>
</element>
</define>
<optional>
<ref name="encryption"/>
</optional>
+ <ref name="diskSourceNetworkProtocolPropsCommon"/>
</element>
</define>
return -1;
}
+ if (src->protocol == VIR_STORAGE_NET_PROTOCOL_HTTP ||
+ src->protocol == VIR_STORAGE_NET_PROTOCOL_HTTPS ||
+ src->protocol == VIR_STORAGE_NET_PROTOCOL_FTP ||
+ src->protocol == VIR_STORAGE_NET_PROTOCOL_FTPS) {
+
+ if (virXPathULongLong("string(./readahead/@size)", ctxt, &src->readahead) == -2 ||
+ virXPathULongLong("string(./timeout/@seconds)", ctxt, &src->timeout) == -2) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("invalid readahead size or timeout"));
+ return -1;
+ }
+ }
+
return 0;
}
virDomainDiskSourceFormatNetworkCookies(childBuf, src);
+ if (src->readahead)
+ virBufferAsprintf(childBuf, "<readahead size='%llu'/>\n", src->readahead);
+
+ if (src->timeout)
+ virBufferAsprintf(childBuf, "<timeout seconds='%llu'/>\n", src->timeout);
+
return 0;
}
def->discard = src->discard;
def->detect_zeroes = src->detect_zeroes;
def->sslverify = src->sslverify;
+ def->readahead = src->readahead;
+ def->timeout = src->timeout;
/* storage driver metadata are not copied */
def->drv = NULL;
bool encryptionInherited;
virStoragePRDefPtr pr;
virTristateBool sslverify;
+ /* both values below have 0 as default value */
+ unsigned long long readahead; /* size of the readahead buffer in bytes */
+ unsigned long long timeout; /* connection timeout in seconds */
virStorageSourceNVMeDefPtr nvme; /* type == VIR_STORAGE_TYPE_NVME */
<cookie name='test'>testcookievalue</cookie>
<cookie name='test2'>blurb</cookie>
</cookies>
+ <readahead size='65536'/>
+ <timeout seconds='10'/>
</source>
<target dev='vdd' bus='virtio'/>
</disk>