[libvirt] [PATCH 0/2] last minute vsock tune-ups

Last-minute change of the element name suggested by Dan: https://www.redhat.com/archives/libvir-list/2018-June/msg00034.html The news patch is rebased on top of Michal's addition: [PATCH for 4.4.0] news: Document two new features introduced in this release <ede7ef017a0a7621c29f01321d1ac4ca436f1ce6.1527839220.git.mprivozn@redhat.com> Ján Tomko (2): conf: rename <vsock><source> to <vsock><cid> news: add vsock docs/formatdomain.html.in | 6 +++--- docs/news.xml | 9 +++++++++ docs/schemas/domaincommon.rng | 4 ++-- src/conf/domain_conf.c | 20 ++++++++++---------- tests/qemuxml2argvdata/vhost-vsock-auto.xml | 2 +- tests/qemuxml2argvdata/vhost-vsock.xml | 2 +- tests/qemuxml2xmloutdata/vhost-vsock-auto.xml | 2 +- 7 files changed, 27 insertions(+), 18 deletions(-) -- 2.16.1

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> --- docs/formatdomain.html.in | 6 +++--- docs/schemas/domaincommon.rng | 4 ++-- src/conf/domain_conf.c | 20 ++++++++++---------- tests/qemuxml2argvdata/vhost-vsock-auto.xml | 2 +- tests/qemuxml2argvdata/vhost-vsock.xml | 2 +- tests/qemuxml2xmloutdata/vhost-vsock-auto.xml | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index b5a6e33bfe..8bb6636ea9 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -8173,8 +8173,8 @@ qemu-kvm -net nic,model=? /dev/null <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> @@ -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> ...</pre> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 703a1bb6f8..b7404e1ce0 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4158,14 +4158,14 @@ </optional> <interleave> <optional> - <element name="source"> + <element name="cid"> <optional> <attribute name="auto"> <ref name="virYesNo"/> </attribute> </optional> <optional> - <attribute name="cid"> + <attribute name="address"> <ref name="unsignedInt"/> </attribute> </optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e40fe7a188..86814d5f64 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 44b3b15f02..f6619d6cd6 100644 --- a/tests/qemuxml2argvdata/vhost-vsock-auto.xml +++ b/tests/qemuxml2argvdata/vhost-vsock-auto.xml @@ -29,7 +29,7 @@ <input type='keyboard' bus='ps2'/> <memballoon model='none'/> <vsock> - <source auto='yes'/> + <cid auto='yes'/> </vsock> </devices> </domain> diff --git a/tests/qemuxml2argvdata/vhost-vsock.xml b/tests/qemuxml2argvdata/vhost-vsock.xml index 636abbb160..bc550ace4e 100644 --- a/tests/qemuxml2argvdata/vhost-vsock.xml +++ b/tests/qemuxml2argvdata/vhost-vsock.xml @@ -29,7 +29,7 @@ <input type='keyboard' bus='ps2'/> <memballoon model='none'/> <vsock model='virtio'> - <source auto='no' cid='4'/> + <cid auto='no' address='4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </vsock> </devices> diff --git a/tests/qemuxml2xmloutdata/vhost-vsock-auto.xml b/tests/qemuxml2xmloutdata/vhost-vsock-auto.xml index 0e0e4a46b4..ef50065063 100644 --- a/tests/qemuxml2xmloutdata/vhost-vsock-auto.xml +++ b/tests/qemuxml2xmloutdata/vhost-vsock-auto.xml @@ -29,7 +29,7 @@ <input type='keyboard' bus='ps2'/> <memballoon model='none'/> <vsock model='virtio'> - <source auto='yes'/> + <cid auto='yes'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </vsock> </devices> -- 2.16.1

On Fri, Jun 01, 2018 at 13:36:04 +0200, Ján Tomko wrote:
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> --- docs/formatdomain.html.in | 6 +++--- docs/schemas/domaincommon.rng | 4 ++-- src/conf/domain_conf.c | 20 ++++++++++---------- tests/qemuxml2argvdata/vhost-vsock-auto.xml | 2 +- tests/qemuxml2argvdata/vhost-vsock.xml | 2 +- tests/qemuxml2xmloutdata/vhost-vsock-auto.xml | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-)
ACK, the new name looks better

On Fri, Jun 01, 2018 at 01:36:04PM +0200, Ján Tomko wrote:
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> --- docs/formatdomain.html.in | 6 +++--- docs/schemas/domaincommon.rng | 4 ++-- src/conf/domain_conf.c | 20 ++++++++++---------- tests/qemuxml2argvdata/vhost-vsock-auto.xml | 2 +- tests/qemuxml2argvdata/vhost-vsock.xml | 2 +- tests/qemuxml2xmloutdata/vhost-vsock-auto.xml | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Document the addition of vsock. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- docs/news.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 453ac1d02a..a2829eff6a 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -113,6 +113,15 @@ libvirt has done as well. </description> </change> + <change> + <summary> + qemu: add support for vhost-vsock-device + </summary> + <description> + A new vsock device was introduced, allowing communication between + the guest and the host via the AF_VSOCK family. + </description> + </change> </section> <section title="Improvements"> <change> -- 2.16.1

On Fri, Jun 01, 2018 at 13:36:05 +0200, Ján Tomko wrote:
Document the addition of vsock.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- docs/news.xml | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml index 453ac1d02a..a2829eff6a 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -113,6 +113,15 @@ libvirt has done as well. </description> </change> + <change> + <summary> + qemu: add support for vhost-vsock-device
I think the more interresting part is the AF_VSOCK transport than the device itself.
+ </summary> + <description> + A new vsock device was introduced, allowing communication between + the guest and the host via the AF_VSOCK family. + </description> + </change>
ACK, our news are not regular-human-friendly anyways.
participants (3)
-
Daniel P. Berrangé
-
Ján Tomko
-
Peter Krempa