All of lore.kernel.org
 help / color / mirror / Atom feed
From: aq <aquynh@gmail.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] set maxmem bugfix
Date: Fri, 15 Jul 2005 17:13:16 +0900	[thread overview]
Message-ID: <9cde8bff05071501132c87df3a@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

Recently some people complain that they cannot set the maxmem for
domU. The problem is that some code wrongly treat dom.max_memkb as in
byte unit, instead of KB unit. This patch fixs the problem.

Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>


$ diffstat maxmem.patch 
 xc_domain.c     |    2 +-
 xc_linux_save.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

[-- Attachment #2: maxmem.patch --]
[-- Type: application/octet-stream, Size: 996 bytes --]

diff -r 1d026c7023d2 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Thu Jul 14 23:48:06 2005
+++ b/tools/libxc/xc_domain.c	Fri Jul 15 17:07:29 2005
@@ -107,7 +107,7 @@
 
         info->ssidref  = op.u.getdomaininfo.ssidref;
         info->nr_pages = op.u.getdomaininfo.tot_pages;
-        info->max_memkb = op.u.getdomaininfo.max_pages<<(PAGE_SHIFT);
+        info->max_memkb = op.u.getdomaininfo.max_pages<<(PAGE_SHIFT - 10);
         info->shared_info_frame = op.u.getdomaininfo.shared_info_frame;
         info->cpu_time = op.u.getdomaininfo.cpu_time;
         info->vcpus = op.u.getdomaininfo.n_vcpu;
diff -r 1d026c7023d2 tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c	Thu Jul 14 23:48:06 2005
+++ b/tools/libxc/xc_linux_save.c	Fri Jul 15 17:07:29 2005
@@ -464,7 +464,7 @@
         goto out;
     }
     
-    nr_pfns = info.max_memkb >> PAGE_SHIFT; 
+    nr_pfns = info.max_memkb >> (PAGE_SHIFT - 10); 
 
     /* cheesy sanity check */
     if ( nr_pfns > 1024*1024 ){

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2005-07-15  8:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-15  8:13 aq [this message]
2005-07-15  8:31 ` [PATCH] set maxmem bugfix Keir Fraser
2005-07-15  8:31   ` aq

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=9cde8bff05071501132c87df3a@mail.gmail.com \
    --to=aquynh@gmail.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.