WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Added a pages_to_kib function, which converts a page cou

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Added a pages_to_kib function, which converts a page count into a number of
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 01 Dec 2005 11:20:12 +0000
Delivery-date: Thu, 01 Dec 2005 11:21:02 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID e6d64c356d63a3528fb202bf91bcd38d248b8065
# Parent  28ce48573771c0f7b07a931dcc35011c7c942af7
Added a pages_to_kib function, which converts a page count into a number of
KiB.  This allows us to compute the correct amount to balloon out to support
a migration.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 28ce48573771 -r e6d64c356d63 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Wed Nov 30 19:55:08 2005
+++ b/tools/python/xen/lowlevel/xc/xc.c Thu Dec  1 03:19:40 2005
@@ -576,6 +576,17 @@
 }
 
 
+static PyObject *pyxc_pages_to_kib(XcObject *self, PyObject *args)
+{
+    unsigned long pages;
+
+    if (!PyArg_ParseTuple(args, "l", &pages))
+        return NULL;
+
+    return PyLong_FromUnsignedLong(pages * (XC_PAGE_SIZE / 1024));
+}
+
+
 static unsigned long pages_to_mb(unsigned long pages)
 {
     return (pages * (XC_PAGE_SIZE / 1024) + 1023) / 1024;
@@ -1058,6 +1069,12 @@
       " nr_ports     [int]: Number of IO ports\n"
       " allow_access [int]: Non-zero means enable access; else disable 
access\n\n"
       "Returns: [int] 0 on success; -1 on error.\n" },
+
+    { "pages_to_kib",
+      (PyCFunction)pyxc_pages_to_kib,
+      METH_VARARGS, "\n"
+      "Returns: [int]: The size in KiB of memory spanning the given number "
+      "of pages.\n" },
 
     { NULL, NULL, 0, NULL }
 };

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Added a pages_to_kib function, which converts a page count into a number of, Xen patchbot -unstable <=