[libvirt] [PATCH] Fix formatting of the memtune XML element

Also output the min_guarantee element when set. --- src/conf/domain_conf.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a997e06..6486f9c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6466,7 +6466,8 @@ char *virDomainDefFormat(virDomainDefPtr def, def->mem.cur_balloon); /* add memtune only if there are any */ - if(def->mem.hard_limit || def->mem.hard_limit || def->mem.hard_limit) + if (def->mem.hard_limit || def->mem.soft_limit || def->mem.min_guarantee || + def->mem.swap_hard_limit) virBufferVSprintf(&buf, " <memtune>\n"); if (def->mem.hard_limit) { virBufferVSprintf(&buf, " <hard_limit>%lu</hard_limit>\n", @@ -6476,11 +6477,16 @@ char *virDomainDefFormat(virDomainDefPtr def, virBufferVSprintf(&buf, " <soft_limit>%lu</soft_limit>\n", def->mem.soft_limit); } + if (def->mem.min_guarantee) { + virBufferVSprintf(&buf, " <min_guarantee>%lu</min_guarantee>\n", + def->mem.min_guarantee); + } if (def->mem.swap_hard_limit) { virBufferVSprintf(&buf, " <swap_hard_limit>%lu</swap_hard_limit>\n", def->mem.swap_hard_limit); } - if(def->mem.hard_limit || def->mem.hard_limit || def->mem.hard_limit) + if (def->mem.hard_limit || def->mem.soft_limit || def->mem.min_guarantee || + def->mem.swap_hard_limit) virBufferVSprintf(&buf, " </memtune>\n"); if (def->mem.hugepage_backed) { -- 1.7.0.4

On Wed, Oct 20, 2010 at 02:03:09PM +0200, Matthias Bolte wrote:
Also output the min_guarantee element when set. --- src/conf/domain_conf.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
ACK, one cleanup, and one bug fix, thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

2010/10/20 Daniel Veillard <veillard@redhat.com>:
On Wed, Oct 20, 2010 at 02:03:09PM +0200, Matthias Bolte wrote:
Also output the min_guarantee element when set. --- src/conf/domain_conf.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
ACK, one cleanup, and one bug fix,
thanks !
Daniel
Thanks, pushed too. Matthias
participants (2)
-
Daniel Veillard
-
Matthias Bolte