[libvirt] [PATCH go-xml] add append attr for chardev

--- domain.go | 5 +++-- domain_test.go | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/domain.go b/domain.go index 82bf728..00231b2 100644 --- a/domain.go +++ b/domain.go @@ -227,8 +227,9 @@ type DomainInterface struct { } type DomainChardevSource struct { - Mode string `xml:"mode,attr"` - Path string `xml:"path,attr"` + Mode string `xml:"mode,attr,omitempty"` + Path string `xml:"path,attr"` + Append string `xml:"append,attr,omitempty"` } type DomainChardevTarget struct { diff --git a/domain_test.go b/domain_test.go index 122aada..f50f1fd 100644 --- a/domain_test.go +++ b/domain_test.go @@ -297,6 +297,16 @@ var domainTestData = []struct { Port: &serialPort, }, }, + DomainSerial{ + Type: "file", + Source: &DomainChardevSource{ + Path: "/tmp/serial.log", + Append: "off", + }, + Target: &DomainSerialTarget{ + Port: &serialPort, + }, + }, }, Channels: []DomainChannel{ DomainChannel{ @@ -332,6 +342,10 @@ var domainTestData = []struct { ` <serial type="pty">`, ` <target type="isa" port="0"></target>`, ` </serial>`, + ` <serial type="file">`, + ` <source path="/tmp/serial.log" append="off"></source>`, + ` <target port="0"></target>`, + ` </serial>`, ` <console type="pty">`, ` <target type="virtio" port="0"></target>`, ` </console>`, -- 2.7.4

On Mon, Jun 26, 2017 at 10:09:23AM +0800, zhenwei.pi wrote:
--- domain.go | 5 +++-- domain_test.go | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-)
Thanks, applied to git 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 :|
participants (2)
-
Daniel P. Berrange
-
zhenwei.pi