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

zhenwei.pi posted 1 patch 6 years, 8 months ago
Failed in applying to current master (apply log)
domain.go      | 5 +++++
domain_test.go | 4 ++++
2 files changed, 9 insertions(+)
[libvirt] [PATCH go-xml] Add support for domain clock and test code
Posted by zhenwei.pi 6 years, 8 months ago
Signed-off-by: zhenwei.pi <zhenwei.pi@youruncloud.com>
---
 domain.go      | 5 +++++
 domain_test.go | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/domain.go b/domain.go
index b9b0f77..8bbf82b 100644
--- a/domain.go
+++ b/domain.go
@@ -532,6 +532,10 @@ type DomainCPU struct {
 	Features []DomainCPUFeature `xml:"feature"`
 }
 
+type DomainClock struct {
+	Offset string `xml:"offset,attr,omitempty"`
+}
+
 type DomainFeature struct {
 }
 
@@ -607,6 +611,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..a263e72 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -491,6 +491,9 @@ var domainTestData = []struct {
 					},
 				},
 			},
+			Clock: &DomainClock{
+				Offset: "utc",
+			},
 		},
 		Expected: []string{
 			`<domain type="kvm">`,
@@ -524,6 +527,7 @@ var domainTestData = []struct {
 			`    <initarg>--unit</initarg>`,
 			`    <initarg>emergency.service</initarg>`,
 			`  </os>`,
+			`  <clock offset="utc"></clock>`,
 			`</domain>`,
 		},
 	},
-- 
2.7.4

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