Add Base element for DomainAddress.
Add address element for DomainMemorydev.
Add test code for new DomainMemorydev.
Signed-off-by: zhenwei.pi <zhenwei.pi(a)youruncloud.com>
---
domain.go | 2 ++
domain_test.go | 9 +++++++++
2 files changed, 11 insertions(+)
diff --git a/domain.go b/domain.go
index bacab11..3d9404f 100644
--- a/domain.go
+++ b/domain.go
@@ -297,6 +297,7 @@ type DomainAddress struct {
Function *HexUint `xml:"function,attr"`
Target *uint `xml:"target,attr"`
Unit *uint `xml:"unit,attr"`
+ Base *HexUint `xml:"base,attr"`
}
type DomainConsole struct {
@@ -450,6 +451,7 @@ type DomainMemorydev struct {
Model string `xml:"model,attr"`
Access string `xml:"access,attr"`
Target *DomainMemorydevTarget `xml:"target"`
+ Address *DomainAddress `xml:"address"`
}
type DomainDeviceList struct {
diff --git a/domain_test.go b/domain_test.go
index dbebe42..cbc5d7f 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -66,6 +66,9 @@ var vcpuId0 uint = 0
var vcpuOrder0 uint = 1
var vcpuId1 uint = 1
+var memorydevAddressSlot HexUint = 0
+var memorydevAddressBase HexUint = 4294967296
+
var domainTestData = []struct {
Object Document
Expected []string
@@ -385,6 +388,11 @@ var domainTestData = []struct {
Value: 0,
},
},
+ Address: &DomainAddress{
+ Type: "dimm",
+ Slot: &memorydevAddressSlot,
+ Base: &memorydevAddressBase,
+ },
},
},
},
@@ -434,6 +442,7 @@ var domainTestData = []struct {
` <size unit="GiB">1</size>`,
` <node>0</node>`,
` </target>`,
+ ` <address type="dimm" slot="0"
base="4294967296"></address>`,
` </memory>`,
` </devices>`,
`</domain>`,
--
2.7.4
Show replies by date