From: Don Slutz <dslutz@verizon.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
xen-devel@lists.xensource.com
Cc: Anthony Perard <anthony.perard@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
dslutz@verizon.com
Subject: Re: [PATCH for-4.5] libxl_set_memory_target: only remove videoram from absolute targets
Date: Wed, 03 Dec 2014 16:46:59 -0500 [thread overview]
Message-ID: <547F84D3.3090501@terremark.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1412031818180.30971@kaball.uk.xensource.com>
On 12/03/14 13:20, Stefano Stabellini wrote:
> If the new target is relative to the current target, do not remove
> videoram again: it has already been removed from the current target.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
>
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index de23fec..2aa83bd 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -4741,13 +4741,17 @@ retry_transaction:
> goto out;
> }
>
> + videoram_s = libxl__xs_read(gc, t, libxl__sprintf(gc,
> + "%s/memory/videoram", dompath));
> + videoram = videoram_s ? atoi(videoram_s) : 0;
> +
> if (relative) {
> if (target_memkb < 0 && abs(target_memkb) > current_target_memkb)
> new_target_memkb = 0;
> else
> new_target_memkb = current_target_memkb + target_memkb;
> } else
> - new_target_memkb = target_memkb;
> + new_target_memkb = target_memkb - videoram;
> if (new_target_memkb > memorykb) {
> LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
> "memory_dynamic_max must be less than or equal to"
> @@ -4763,9 +4767,6 @@ retry_transaction:
> abort_transaction = 1;
> goto out;
> }
> - videoram_s = libxl__xs_read(gc, t, libxl__sprintf(gc,
> - "%s/memory/videoram", dompath));
> - videoram = videoram_s ? atoi(videoram_s) : 0;
>
> if (enforce) {
> memorykb = new_target_memkb;
Since new_target_memkb is now adjusted before this line, you
need to change this to:
memorykb = new_target_memkb + videoram;
-Don Slutz
> @@ -4780,7 +4781,6 @@ retry_transaction:
> }
> }
>
> - new_target_memkb -= videoram;
> rc = xc_domain_set_pod_target(ctx->xch, domid,
> new_target_memkb / 4, NULL, NULL, NULL);
> if (rc != 0) {
next prev parent reply other threads:[~2014-12-03 21:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 18:20 [PATCH for-4.5] libxl_set_memory_target: only remove videoram from absolute targets Stefano Stabellini
2014-12-03 20:41 ` Konrad Rzeszutek Wilk
2014-12-04 12:21 ` Stefano Stabellini
2014-12-03 21:46 ` Don Slutz [this message]
2014-12-04 12:26 ` Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=547F84D3.3090501@terremark.com \
--to=dslutz@verizon.com \
--cc=anthony.perard@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.