[PATCH go-xml] add append attr for chardev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux