diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index b5a6e33bfe07dea497e87f25480db9aa2cf3cbcc..8bb6636ea9f997d8b233ddb97636aab57f43eb49 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -8173,8 +8173,8 @@ qemu-kvm -net nic,model=? /dev/null

A vsock host/guest interface. The model attribute defaults to virtio. - The optional attribute cid of the source element - specifies the CID assigned to the guest. If the attribute + The optional attribute address of the cid + element specifies the CID assigned to the guest. If the attribute auto is set to yes, libvirt will assign a free CID automatically on domain startup. Since 4.4.0

@@ -8183,7 +8183,7 @@ qemu-kvm -net nic,model=? /dev/null ... <devices> <vsock model='virtio'> - <source auto='no' cid='3'/> + <cid auto='no' address='3'/> </vsock> </devices> ... diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 703a1bb6f8e0b3dc271788cf932e7351f4b8aa35..b7404e1ce000cd26cfb56c31580b642cea593e41 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4158,14 +4158,14 @@ - + - + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e40fe7a1888e128f79b3bdab612229f6a546a88c..86814d5f64b9f6e470e3c8f31c8068c4440cae88 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15966,7 +15966,7 @@ virDomainVsockDefParseXML(virDomainXMLOptionPtr xmlopt, { virDomainVsockDefPtr vsock = NULL, ret = NULL; xmlNodePtr save = ctxt->node; - xmlNodePtr source; + xmlNodePtr cid; char *tmp = NULL; int val; @@ -15983,11 +15983,11 @@ virDomainVsockDefParseXML(virDomainXMLOptionPtr xmlopt, 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, @@ -15998,7 +15998,7 @@ virDomainVsockDefParseXML(virDomainXMLOptionPtr xmlopt, } VIR_FREE(tmp); - if ((tmp = virXMLPropString(source, "auto"))) { + if ((tmp = virXMLPropString(cid, "auto"))) { val = virTristateBoolTypeFromString(tmp); if (val <= 0) { virReportError(VIR_ERR_XML_DETAIL, @@ -26993,7 +26993,7 @@ virDomainVsockDefFormat(virBufferPtr buf, { 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) { @@ -27004,12 +27004,12 @@ virDomainVsockDefFormat(virBufferPtr buf, 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); @@ -27022,7 +27022,7 @@ virDomainVsockDefFormat(virBufferPtr buf, cleanup: virBufferFreeAndReset(&childBuf); virBufferFreeAndReset(&attrBuf); - virBufferFreeAndReset(&sourceAttrBuf); + virBufferFreeAndReset(&cidAttrBuf); return ret; } diff --git a/tests/qemuxml2argvdata/vhost-vsock-auto.xml b/tests/qemuxml2argvdata/vhost-vsock-auto.xml index 44b3b15f02477ddf14fcb66c2cef4b61ff5ae9f4..f6619d6cd69965c895988b4fb702bb15545200e8 100644 --- a/tests/qemuxml2argvdata/vhost-vsock-auto.xml +++ b/tests/qemuxml2argvdata/vhost-vsock-auto.xml @@ -29,7 +29,7 @@ - + diff --git a/tests/qemuxml2argvdata/vhost-vsock.xml b/tests/qemuxml2argvdata/vhost-vsock.xml index 636abbb16085a7b2441fc3dcaca6752253cc26a9..bc550ace4ef3f4e043ebd64ea87cce8118b0d1aa 100644 --- a/tests/qemuxml2argvdata/vhost-vsock.xml +++ b/tests/qemuxml2argvdata/vhost-vsock.xml @@ -29,7 +29,7 @@ - +
diff --git a/tests/qemuxml2xmloutdata/vhost-vsock-auto.xml b/tests/qemuxml2xmloutdata/vhost-vsock-auto.xml index 0e0e4a46b4800cc4519c3cad5e5190a35a3bf410..ef50065063729613c9245908d7ed24de51264155 100644 --- a/tests/qemuxml2xmloutdata/vhost-vsock-auto.xml +++ b/tests/qemuxml2xmloutdata/vhost-vsock-auto.xml @@ -29,7 +29,7 @@ - +