[PATCH go-xml] Add support for domain input address

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

 



---
 domain.go      |  5 +++--
 domain_test.go | 11 ++++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/domain.go b/domain.go
index bf0b851..dcb8f65 100644
--- a/domain.go
+++ b/domain.go
@@ -232,8 +232,9 @@ type DomainChardev struct {
 }
 
 type DomainInput struct {
-	Type string `xml:"type,attr"`
-	Bus  string `xml:"bus,attr"`
+	Type    string         `xml:"type,attr"`
+	Bus     string         `xml:"bus,attr"`
+	Address *DomainAddress `xml:"address"`
 }
 
 type DomainGraphicListener struct {
diff --git a/domain_test.go b/domain_test.go
index 7990627..632b714 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -48,6 +48,8 @@ var balloonAddr = Address{0, 0, 7, 0}
 var duplexAddr = Address{0, 0, 8, 0}
 
 var serialPort uint = 0
+var tabletBus uint = 0
+var tabletPort uint = 1
 
 var domainTestData = []struct {
 	Object   *Domain
@@ -230,6 +232,11 @@ var domainTestData = []struct {
 					DomainInput{
 						Type: "tablet",
 						Bus:  "usb",
+						Address: &DomainAddress{
+							Type: "usb",
+							Bus:  &tabletBus,
+							Port: &tabletPort,
+						},
 					},
 					DomainInput{
 						Type: "keyboard",
@@ -301,7 +308,9 @@ var domainTestData = []struct {
 			`    <serial type="pty">`,
 			`      <target port="0"></target>`,
 			`    </serial>`,
-			`    <input type="tablet" bus="usb"></input>`,
+			`    <input type="tablet" bus="usb">`,
+			`      <address type="usb" bus="0" port="1"></address>`,
+			`    </input>`,
 			`    <input type="keyboard" bus="ps2"></input>`,
 			`    <graphics type="vnc"></graphics>`,
 			`    <video>`,
-- 
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