xend: Fix 20825:49a2c1069e14

Converting an Python Int, sizeof(long) already returns byte length
rather than bit length so do not divide-by-8.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
Keir Fraser committed 2010-01-20 09:51:38 +00:00
1 parent 2e883df395
commit 9e5e0eb840
1 file changed
+1 -1
+1 -1
View File
@@ -933,7 +933,7 @@ static PyObject *pyxc_hvm_build(XcObject *self,
if ( PyInt_Check(vcpu_avail_handle) )
{
unsigned long v = PyInt_AsLong(vcpu_avail_handle);
for ( i = 0; i < sizeof(long)/8; i++ )
for ( i = 0; i < sizeof(long); i++ )
vcpu_avail[i] = (uint8_t)(v>>(i*8));
}
else if ( PyLong_Check(vcpu_avail_handle) )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.