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

zhenwei.pi posted 1 patch 6 years, 10 months ago
Failed in applying to current master (apply log)
domain.go      |  5 +++--
domain_test.go | 11 ++++++++++-
2 files changed, 13 insertions(+), 3 deletions(-)
[libvirt] [PATCH go-xml] Add support for domain input address
Posted by zhenwei.pi 6 years, 10 months ago
---
 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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH go-xml] Add support for domain input address
Posted by Daniel P. Berrange 6 years, 10 months ago
On Thu, Jun 01, 2017 at 05:49:59PM +0800, zhenwei.pi wrote:
> ---
>  domain.go      |  5 +++--
>  domain_test.go | 11 ++++++++++-
>  2 files changed, 13 insertions(+), 3 deletions(-)

Thanks, I've pushed this


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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH go-xml] Add support for domain input address
Posted by ZhenweiPi 6 years, 10 months ago
---

  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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list