[libvirt] [PATCH go-xml] Improve DomainChardevSource.

Brandon Bergren git at bdragon.rtk0.net
Sat Nov 4 20:18:31 UTC 2017


* Add missing attributes to DomainChardevSource.

* Change Path to be omitempty because several chardev types do not use it.

* Document which chardev types use which attributes (for convenience)

I was mainly interested in making it possible to define nmdm devices from go code,
but I figured I would add the other missing attributes while I was here.
---
 domain.go | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/domain.go b/domain.go
index f4ef35c..debc5b2 100644
--- a/domain.go
+++ b/domain.go
@@ -256,9 +256,15 @@ type DomainInterface struct {
 }
 
 type DomainChardevSource struct {
-	Mode   string `xml:"mode,attr,omitempty"`
-	Path   string `xml:"path,attr"`
-	Append string `xml:"append,attr,omitempty"`
+	Mode     string `xml:"mode,attr,omitempty"`    // tcp,udp,unix
+	Path     string `xml:"path,attr,omitempty"`    // file,pty,dev,pipe
+	Channnel string `xml:"channel,attr,omitempty"` // spiceport
+	Append   string `xml:"append,attr,omitempty"`  // file
+	Host     string `xml:"host,attr,omitempty"`    // tcp,udp
+	Service  string `xml:"service,attr,omitempty"` // tcp,udp
+	TLS      string `xml:"tls,attr,omitempty"`     // tcp(QEMU)
+	Master   string `xml:"master,attr,omitempty"`  // nmdm
+	Slave    string `xml:"slave,attr,omitempty"`   // nmdm
 }
 
 type DomainChardevTarget struct {
-- 
2.14.1




More information about the libvir-list mailing list