1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

conf: rename <vsock><source> to <vsock><cid>

To avoid the <source> vs. <target> confusion,
change <source auto='no' cid='3'/> to:
<cid auto='no' address='3'/>

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Ján Tomko 2018-06-01 13:22:56 +02:00
parent 455e6d57b2
commit 023ea2a869
6 changed files with 18 additions and 18 deletions

View File

@ -8173,8 +8173,8 @@ qemu-kvm -net nic,model=? /dev/null
<p>A vsock host/guest interface. The <code>model</code> attribute <p>A vsock host/guest interface. The <code>model</code> attribute
defaults to <code>virtio</code>. defaults to <code>virtio</code>.
The optional attribute <code>cid</code> of the source element The optional attribute <code>address</code> of the <code>cid</code>
specifies the CID assigned to the guest. If the attribute element specifies the CID assigned to the guest. If the attribute
<code>auto</code> is set to <code>yes</code>, libvirt <code>auto</code> is set to <code>yes</code>, libvirt
will assign a free CID automatically on domain startup. will assign a free CID automatically on domain startup.
<span class="since">Since 4.4.0</span></p> <span class="since">Since 4.4.0</span></p>
@ -8183,7 +8183,7 @@ qemu-kvm -net nic,model=? /dev/null
... ...
&lt;devices&gt; &lt;devices&gt;
&lt;vsock model='virtio'&gt; &lt;vsock model='virtio'&gt;
&lt;source auto='no' cid='3'/&gt; &lt;cid auto='no' address='3'/&gt;
&lt;/vsock&gt; &lt;/vsock&gt;
&lt;/devices&gt; &lt;/devices&gt;
...</pre> ...</pre>

View File

@ -4158,14 +4158,14 @@
</optional> </optional>
<interleave> <interleave>
<optional> <optional>
<element name="source"> <element name="cid">
<optional> <optional>
<attribute name="auto"> <attribute name="auto">
<ref name="virYesNo"/> <ref name="virYesNo"/>
</attribute> </attribute>
</optional> </optional>
<optional> <optional>
<attribute name="cid"> <attribute name="address">
<ref name="unsignedInt"/> <ref name="unsignedInt"/>
</attribute> </attribute>
</optional> </optional>

View File

@ -15966,7 +15966,7 @@ virDomainVsockDefParseXML(virDomainXMLOptionPtr xmlopt,
{ {
virDomainVsockDefPtr vsock = NULL, ret = NULL; virDomainVsockDefPtr vsock = NULL, ret = NULL;
xmlNodePtr save = ctxt->node; xmlNodePtr save = ctxt->node;
xmlNodePtr source; xmlNodePtr cid;
char *tmp = NULL; char *tmp = NULL;
int val; int val;
@ -15983,11 +15983,11 @@ virDomainVsockDefParseXML(virDomainXMLOptionPtr xmlopt,
vsock->model = val; vsock->model = val;
} }
source = virXPathNode("./source", ctxt); cid = virXPathNode("./cid", ctxt);
VIR_FREE(tmp); VIR_FREE(tmp);
if (source) { if (cid) {
if ((tmp = virXMLPropString(source, "cid"))) { if ((tmp = virXMLPropString(cid, "address"))) {
if (virStrToLong_uip(tmp, NULL, 10, &vsock->guest_cid) < 0 || if (virStrToLong_uip(tmp, NULL, 10, &vsock->guest_cid) < 0 ||
vsock->guest_cid == 0) { vsock->guest_cid == 0) {
virReportError(VIR_ERR_XML_DETAIL, virReportError(VIR_ERR_XML_DETAIL,
@ -15998,7 +15998,7 @@ virDomainVsockDefParseXML(virDomainXMLOptionPtr xmlopt,
} }
VIR_FREE(tmp); VIR_FREE(tmp);
if ((tmp = virXMLPropString(source, "auto"))) { if ((tmp = virXMLPropString(cid, "auto"))) {
val = virTristateBoolTypeFromString(tmp); val = virTristateBoolTypeFromString(tmp);
if (val <= 0) { if (val <= 0) {
virReportError(VIR_ERR_XML_DETAIL, virReportError(VIR_ERR_XML_DETAIL,
@ -26993,7 +26993,7 @@ virDomainVsockDefFormat(virBufferPtr buf,
{ {
virBuffer childBuf = VIR_BUFFER_INITIALIZER; virBuffer childBuf = VIR_BUFFER_INITIALIZER;
virBuffer attrBuf = VIR_BUFFER_INITIALIZER; virBuffer attrBuf = VIR_BUFFER_INITIALIZER;
virBuffer sourceAttrBuf = VIR_BUFFER_INITIALIZER; virBuffer cidAttrBuf = VIR_BUFFER_INITIALIZER;
int ret = -1; int ret = -1;
if (vsock->model) { if (vsock->model) {
@ -27004,12 +27004,12 @@ virDomainVsockDefFormat(virBufferPtr buf,
virBufferSetChildIndent(&childBuf, buf); virBufferSetChildIndent(&childBuf, buf);
if (vsock->auto_cid != VIR_TRISTATE_BOOL_ABSENT) { if (vsock->auto_cid != VIR_TRISTATE_BOOL_ABSENT) {
virBufferAsprintf(&sourceAttrBuf, " auto='%s'", virBufferAsprintf(&cidAttrBuf, " auto='%s'",
virTristateBoolTypeToString(vsock->auto_cid)); virTristateBoolTypeToString(vsock->auto_cid));
} }
if (vsock->guest_cid != 0) if (vsock->guest_cid != 0)
virBufferAsprintf(&sourceAttrBuf, " cid='%u'", vsock->guest_cid); virBufferAsprintf(&cidAttrBuf, " address='%u'", vsock->guest_cid);
if (virXMLFormatElement(&childBuf, "source", &sourceAttrBuf, NULL) < 0) if (virXMLFormatElement(&childBuf, "cid", &cidAttrBuf, NULL) < 0)
goto cleanup; goto cleanup;
virDomainDeviceInfoFormat(&childBuf, &vsock->info, 0); virDomainDeviceInfoFormat(&childBuf, &vsock->info, 0);
@ -27022,7 +27022,7 @@ virDomainVsockDefFormat(virBufferPtr buf,
cleanup: cleanup:
virBufferFreeAndReset(&childBuf); virBufferFreeAndReset(&childBuf);
virBufferFreeAndReset(&attrBuf); virBufferFreeAndReset(&attrBuf);
virBufferFreeAndReset(&sourceAttrBuf); virBufferFreeAndReset(&cidAttrBuf);
return ret; return ret;
} }

View File

@ -29,7 +29,7 @@
<input type='keyboard' bus='ps2'/> <input type='keyboard' bus='ps2'/>
<memballoon model='none'/> <memballoon model='none'/>
<vsock> <vsock>
<source auto='yes'/> <cid auto='yes'/>
</vsock> </vsock>
</devices> </devices>
</domain> </domain>

View File

@ -29,7 +29,7 @@
<input type='keyboard' bus='ps2'/> <input type='keyboard' bus='ps2'/>
<memballoon model='none'/> <memballoon model='none'/>
<vsock model='virtio'> <vsock model='virtio'>
<source auto='no' cid='4'/> <cid auto='no' address='4'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</vsock> </vsock>
</devices> </devices>

View File

@ -29,7 +29,7 @@
<input type='keyboard' bus='ps2'/> <input type='keyboard' bus='ps2'/>
<memballoon model='none'/> <memballoon model='none'/>
<vsock model='virtio'> <vsock model='virtio'>
<source auto='yes'/> <cid auto='yes'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</vsock> </vsock>
</devices> </devices>