<p>A vsock host/guest interface. The <code>model</code> attribute
defaults to <code>virtio</code>.
- The optional attribute <code>cid</code> of the source element
- specifies the CID assigned to the guest. If the attribute
+ The optional attribute <code>address</code> of the <code>cid</code>
+ element specifies the CID assigned to the guest. If the attribute
<code>auto</code> is set to <code>yes</code>, libvirt
will assign a free CID automatically on domain startup.
<span class="since">Since 4.4.0</span></p>
...
<devices>
<vsock model='virtio'>
- <source auto='no' cid='3'/>
+ <cid auto='no' address='3'/>
</vsock>
</devices>
...</pre>
{
virDomainVsockDefPtr vsock = NULL, ret = NULL;
xmlNodePtr save = ctxt->node;
- xmlNodePtr source;
+ xmlNodePtr cid;
char *tmp = NULL;
int val;
vsock->model = val;
}
- source = virXPathNode("./source", ctxt);
+ cid = virXPathNode("./cid", ctxt);
VIR_FREE(tmp);
- if (source) {
- if ((tmp = virXMLPropString(source, "cid"))) {
+ if (cid) {
+ if ((tmp = virXMLPropString(cid, "address"))) {
if (virStrToLong_uip(tmp, NULL, 10, &vsock->guest_cid) < 0 ||
vsock->guest_cid == 0) {
virReportError(VIR_ERR_XML_DETAIL,
}
VIR_FREE(tmp);
- if ((tmp = virXMLPropString(source, "auto"))) {
+ if ((tmp = virXMLPropString(cid, "auto"))) {
val = virTristateBoolTypeFromString(tmp);
if (val <= 0) {
virReportError(VIR_ERR_XML_DETAIL,
{
virBuffer childBuf = VIR_BUFFER_INITIALIZER;
virBuffer attrBuf = VIR_BUFFER_INITIALIZER;
- virBuffer sourceAttrBuf = VIR_BUFFER_INITIALIZER;
+ virBuffer cidAttrBuf = VIR_BUFFER_INITIALIZER;
int ret = -1;
if (vsock->model) {
virBufferSetChildIndent(&childBuf, buf);
if (vsock->auto_cid != VIR_TRISTATE_BOOL_ABSENT) {
- virBufferAsprintf(&sourceAttrBuf, " auto='%s'",
+ virBufferAsprintf(&cidAttrBuf, " auto='%s'",
virTristateBoolTypeToString(vsock->auto_cid));
}
if (vsock->guest_cid != 0)
- virBufferAsprintf(&sourceAttrBuf, " cid='%u'", vsock->guest_cid);
- if (virXMLFormatElement(&childBuf, "source", &sourceAttrBuf, NULL) < 0)
+ virBufferAsprintf(&cidAttrBuf, " address='%u'", vsock->guest_cid);
+ if (virXMLFormatElement(&childBuf, "cid", &cidAttrBuf, NULL) < 0)
goto cleanup;
virDomainDeviceInfoFormat(&childBuf, &vsock->info, 0);
cleanup:
virBufferFreeAndReset(&childBuf);
virBufferFreeAndReset(&attrBuf);
- virBufferFreeAndReset(&sourceAttrBuf);
+ virBufferFreeAndReset(&cidAttrBuf);
return ret;
}