[PATCH go-xml] Add address support for memory device

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

 



Add Base element for DomainAddress.
Add address element for DomainMemorydev.
Add test code for new DomainMemorydev.

Signed-off-by: zhenwei.pi <zhenwei.pi@xxxxxxxxxxxxxxx>
---
 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

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