Nice catch, thank you. Patch applied. Hopefully that takes care of the
last of the total memory ints.
On 07/24/2011 09:08 PM, Anton Blanchard wrote:
Hi,
I was trying to install on a box with 8TB of RAM and hit the same
issue. I wanted to verify upstream git is fixed but I struggled to get
anaconda to build. I instead built the isys module and wrote a small
test case:
#!/usr/bin/python
import isys;
total_ram = int(isys.total_memory() / 1024)
print isys.total_memory()
print total_ram;
I still see negative numbers with upstream git:
# ./foo.py
-104333312
-101888
With the attached patch I see the right numbers:
# ./foo.py
4190633984
4092416
I only have 4TB enabled right now.
If we assume all large memory boxes are 64bit we might be able to get
away with just changing tm to a long. Thoughts?
Anton
--
diff --git a/pyanaconda/isys/isys.c b/pyanaconda/isys/isys.c
index 33d72cc..4817e17 100644
--- a/pyanaconda/isys/isys.c
+++ b/pyanaconda/isys/isys.c
@@ -656,8 +656,8 @@ static PyObject * doIsWirelessDevice(PyObject * s, PyObject * args) {
}
static PyObject * doTotalMemory(PyObject * s) {
- int tm = totalMemory();
- return PyInt_FromLong(tm);
+ unsigned long long tm = totalMemory();
+ return PyLong_FromUnsignedLongLong(tm);
}
/* vim:set shiftwidth=4 softtabstop=4: */
--
David Cantrell <dcantrell@xxxxxxxxxx>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list