[PATCH go-xml] support virtualport for interface and add test code

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

 



---

  domain.go      | 29 +++++++++++++++++------------
  domain_test.go |  4 ++++
  2 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/domain.go b/domain.go
index eb7ff9e..ecb8550 100644
--- a/domain.go
+++ b/domain.go
@@ -185,19 +185,24 @@ type DomainInterfaceDriver struct {
  	Queues uint   `xml:"queues,attr,omitempty"`
  }
+type DomainInterfaceVirtualport struct {
+	Type string `xml:"type,attr"`
+}
+
  type DomainInterface struct {
-	XMLName xml.Name               `xml:"interface"`
-	Type    string                 `xml:"type,attr"`
-	MAC     *DomainInterfaceMAC    `xml:"mac"`
-	Model   *DomainInterfaceModel  `xml:"model"`
-	Source  *DomainInterfaceSource `xml:"source"`
-	Target  *DomainInterfaceTarget `xml:"target"`
-	Alias   *DomainInterfaceAlias  `xml:"alias"`
-	Link    *DomainInterfaceLink   `xml:"link"`
-	Boot    *DomainDeviceBoot      `xml:"boot"`
-	Script  *DomainInterfaceScript `xml:"script"`
-	Driver  *DomainInterfaceDriver `xml:"driver"`
-	Address *DomainAddress         `xml:"address"`
+	XMLName     xml.Name                    `xml:"interface"`
+	Type        string                      `xml:"type,attr"`
+	MAC         *DomainInterfaceMAC         `xml:"mac"`
+	Model       *DomainInterfaceModel       `xml:"model"`
+	Source      *DomainInterfaceSource      `xml:"source"`
+	Target      *DomainInterfaceTarget      `xml:"target"`
+	Alias       *DomainInterfaceAlias       `xml:"alias"`
+	Link        *DomainInterfaceLink        `xml:"link"`
+	Boot        *DomainDeviceBoot           `xml:"boot"`
+	Script      *DomainInterfaceScript      `xml:"script"`
+	Driver      *DomainInterfaceDriver      `xml:"driver"`
+	Virtualport *DomainInterfaceVirtualport `xml:"virtualport"`
+	Address     *DomainAddress              `xml:"address"`
  }
type DomainChardevSource struct {
diff --git a/domain_test.go b/domain_test.go
index 6b37719..9de725c 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -565,6 +565,9 @@ var domainTestData = []struct {
  						Model: &DomainInterfaceModel{
  							Type: "virtio",
  						},
+						Virtualport: &DomainInterfaceVirtualport{
+							Type: "openvswitch",
+						},
  					},
  				},
  			},
@@ -577,6 +580,7 @@ var domainTestData = []struct {
  			`    <interface type="network">`,
  			`      <mac address="00:11:22:33:44:55"></mac>`,
  			`      <model type="virtio"></model>`,
+			`      <virtualport type="openvswitch"></virtualport>`,
  			`    </interface>`,
  			`  </devices>`,
  			`</domain>`,
--
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