[PATCH go-xml] Add support for domain clock and test code

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

 



Signed-off-by: zhenwei.pi <zhenwei.pi@xxxxxxxxxxxxxxx>
---
 domain.go      | 7 +++++++
 domain_test.go | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/domain.go b/domain.go
index b9b0f77..1d020aa 100644
--- a/domain.go
+++ b/domain.go
@@ -532,6 +532,12 @@ type DomainCPU struct {
 	Features []DomainCPUFeature `xml:"feature"`
 }
 
+type DomainClock struct {
+	Offset     string `xml:"offset,attr,omitempty"`
+	Basic      string `xml:"basic,attr,omitempty"`
+	Adjustment int    `xml:"adjustment,attr,omitempty"`
+}
+
 type DomainFeature struct {
 }
 
@@ -607,6 +613,7 @@ type Domain struct {
 	OS            *DomainOS          `xml:"os"`
 	Features      *DomainFeatureList `xml:"features"`
 	CPU           *DomainCPU         `xml:"cpu"`
+	Clock         *DomainClock       `xml:"clock,omitempty"`
 	OnPoweroff    string             `xml:"on_poweroff,omitempty"`
 	OnReboot      string             `xml:"on_reboot,omitempty"`
 	OnCrash       string             `xml:"on_crash,omitempty"`
diff --git a/domain_test.go b/domain_test.go
index 47e5e26..536b94c 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -491,6 +491,11 @@ var domainTestData = []struct {
 					},
 				},
 			},
+			Clock: &DomainClock{
+				Offset:     "variable",
+				Basic:      "utc",
+				Adjustment: 28794,
+			},
 		},
 		Expected: []string{
 			`<domain type="kvm">`,
@@ -524,6 +529,7 @@ var domainTestData = []struct {
 			`    <initarg>--unit</initarg>`,
 			`    <initarg>emergency.service</initarg>`,
 			`  </os>`,
+			`  <clock offset="variable" basic="utc" adjustment="28794"></clock>`,
 			`</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