Skip to contentSkip to conversation

exec: use macro ROUND_UP for alignment

PATCH In review Chen Hanxiao 2 participants 3 messages Jul 24, 2015 – Jul 28, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 exec: use macro ROUND_UP for alignment

Use ROUND_UP instead.

---
 exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
exec.c +1 -1
index 7d60e15..bb16c50 100644
@@ -1207,7 +1207,7 @@ static void *file_ram_alloc(RAMBlock *block,
     unlink(filename);
     g_free(filename);
 
-    memory = (memory+hpagesize-1) & ~(hpagesize-1);
+    memory = ROUND_UP(memory, hpagesize);
 
     /*
      * ftruncate is not supported by hugetlbfs in older
Signature · 1 line
2.1.0
#1 lore raw
Quoted 31 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Chen Hanxiao
Sent: Friday, July 24, 2015 11:12 AM
To: Paolo Bonzini
Cc: [email protected]
Subject: [Qemu-devel] [PATCH v2] exec: use macro ROUND_UP for alignment

Use ROUND_UP instead.

---
 exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
exec.c +1 -2
index 7d60e15..bb16c50 100644
@@ -1207,7 +1207,7 @@ static void *file_ram_alloc(RAMBlock *block,
     unlink(filename);
     g_free(filename);
 
-    memory = (memory+hpagesize-1) & ~(hpagesize-1);
+    memory = ROUND_UP(memory, hpagesize);
 
     /*
      * ftruncate is not supported by hugetlbfs in older
--
Quoted 2 lines

2.1.0

ping

Regards,
- Chen

#2 lore raw
Quoted 28 lines · Hanxiao
Quoted 28 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Chen Hanxiao
Sent: Friday, July 24, 2015 11:12 AM
To: Paolo Bonzini
Cc: [email protected]
Subject: [Qemu-devel] [PATCH v2] exec: use macro ROUND_UP for alignment

Use ROUND_UP instead.

---
 exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
exec.c +1 -1
index 7d60e15..bb16c50 100644
@@ -1207,7 +1207,7 @@ static void *file_ram_alloc(RAMBlock *block,
     unlink(filename);
     g_free(filename);
 
-    memory = (memory+hpagesize-1) & ~(hpagesize-1);
+    memory = ROUND_UP(memory, hpagesize);
 
Quoted 7 lines
Quoted 5 lines
exec.c +0 -1
     /*
      * ftruncate is not supported by hugetlbfs in older
--

2.1.0

ping

QEMU is in hard freeze. It's normal to wait a few days more for non-bugfix patches. This one is okay, though.

Paolo