• Subject: [libvirt] [PATCH go-xml] Add support for CPUTune in Domain
  • Author: Michal Rostecki
  • Date: Oct. 25, 2017, 3:32 p.m.
  • Patches: 1 / 1
Changeset
domain.go      | 19 +++++++++++++++++++
domain_test.go | 20 ++++++++++++++++++++
2 files changed, 39 insertions(+)
Git apply log
Switched to a new branch '20171025153232.22317-1-michal@kinvolk.io'
Applying: Add support for CPUTune in Domain
error: sha1 information is lacking or useless (domain.go).
error: could not build fake ancestor
Patch failed at 0001 Add support for CPUTune in Domain
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Failed to apply patch:
[libvirt] [PATCH go-xml] Add support for CPUTune in Domain
[libvirt] [PATCH go-xml] Add support for CPUTune in Domain
Posted by Michal Rostecki, 12 weeks ago
From: Michal Rostecki <michal.rostecki@gmail.com>

Signed-off-by: Victoria Efimova <neverpushthisbutton@yandex.ru>
Signed-off-by: Ivan Shvedunov <ischvedunov@mirantis.com>
Signed-off-by: Miha Pleško <miha.plesko@xlab.si>
Signed-off-by: Michal Rostecki <michal.rostecki@gmail.com>
---
 domain.go      | 19 +++++++++++++++++++
 domain_test.go | 20 ++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/domain.go b/domain.go
index bacab11..3efd68c 100644
--- a/domain.go
+++ b/domain.go
@@ -722,6 +722,24 @@ type DomainFeatureList struct {
 	SMM        *DomainFeatureState  `xml:"smm"`
 }
 
+type DomainCPUTuneShares struct {
+	Value uint `xml:",chardata"`
+}
+
+type DomainCPUTunePeriod struct {
+	Value uint64 `xml:",chardata"`
+}
+
+type DomainCPUTuneQuota struct {
+	Value int64 `xml:",chardata"`
+}
+
+type DomainCPUTune struct {
+	Shares *DomainCPUTuneShares `xml:"shares"`
+	Period *DomainCPUTunePeriod `xml:"period"`
+	Quota  *DomainCPUTuneQuota  `xml:"quota"`
+}
+
 type DomainQEMUCommandlineArg struct {
 	Value string `xml:"value,attr"`
 }
@@ -751,6 +769,7 @@ type Domain struct {
 	MemoryBacking   *DomainMemoryBacking `xml:"memoryBacking"`
 	VCPU            *DomainVCPU          `xml:"vcpu"`
 	VCPUs           *DomainVCPUs         `xml:"vcpus"`
+	CPUTune         *DomainCPUTune       `xml:"cputune"`
 	Resource        *DomainResource      `xml:"resource"`
 	SysInfo         *DomainSysInfo       `xml:"sysinfo"`
 	OS              *DomainOS            `xml:"os"`
diff --git a/domain_test.go b/domain_test.go
index dbebe42..b427b50 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -1335,6 +1335,26 @@ var domainTestData = []struct {
 			`</domain>`,
 		},
 	},
+	{
+		Object: &Domain{
+			Name: "test",
+			CPUTune: &DomainCPUTune{
+				Shares: &DomainCPUTuneShares{Value: 1024},
+				Period: &DomainCPUTunePeriod{Value: 500000},
+				Quota:  &DomainCPUTuneQuota{Value: -1},
+			},
+		},
+		Expected: []string{
+			`<domain>`,
+			`  <name>test</name>`,
+			`  <cputune>`,
+			`    <shares>1024</shares>`,
+			`    <period>500000</period>`,
+			`    <quota>-1</quota>`,
+			`  </cputune>`,
+			`</domain>`,
+		},
+	},
 
 	/* Tests for sub-documents that can be hotplugged */
 	{
-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH go-xml] Add support for CPUTune in Domain
Posted by Daniel P. Berrange, 11 weeks ago
On Wed, Oct 25, 2017 at 04:32:32PM +0100, Michal Rostecki wrote:
> From: Michal Rostecki <michal.rostecki@gmail.com>
> 
> Signed-off-by: Victoria Efimova <neverpushthisbutton@yandex.ru>
> Signed-off-by: Ivan Shvedunov <ischvedunov@mirantis.com>
> Signed-off-by: Miha Pleško <miha.plesko@xlab.si>
> Signed-off-by: Michal Rostecki <michal.rostecki@gmail.com>
> ---
>  domain.go      | 19 +++++++++++++++++++
>  domain_test.go | 20 ++++++++++++++++++++
>  2 files changed, 39 insertions(+)

Thanks, I've pushed this to master too.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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