[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 072/103] memory: move RAM_PREALLOC_MASK to exec.c, re
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 072/103] memory: move RAM_PREALLOC_MASK to exec.c, rename |
Date: |
Tue, 17 Jun 2014 20:40:40 +0300 |
From: Paolo Bonzini <address@hidden>
Prepare for adding more flags. The "_MASK" suffix is unique, kill it.
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Hu Tao <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
---
include/exec/cpu-all.h | 3 ---
exec.c | 9 ++++++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index eaddea6..f91581f 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -297,9 +297,6 @@ CPUArchState *cpu_copy(CPUArchState *env);
/* memory API */
-/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
-#define RAM_PREALLOC_MASK (1 << 0)
-
typedef struct RAMBlock {
struct MemoryRegion *mr;
uint8_t *host;
diff --git a/exec.c b/exec.c
index f32e15d..98878a4 100644
--- a/exec.c
+++ b/exec.c
@@ -70,6 +70,9 @@ AddressSpace address_space_memory;
MemoryRegion io_mem_rom, io_mem_notdirty;
static MemoryRegion io_mem_unassigned;
+/* RAM is pre-allocated and passed into qemu_ram_alloc_from_ptr */
+#define RAM_PREALLOC (1 << 0)
+
#endif
struct CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus);
@@ -1309,7 +1312,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void
*host,
new_block->fd = -1;
new_block->host = host;
if (host) {
- new_block->flags |= RAM_PREALLOC_MASK;
+ new_block->flags |= RAM_PREALLOC;
}
return ram_block_add(new_block);
}
@@ -1348,7 +1351,7 @@ void qemu_ram_free(ram_addr_t addr)
QTAILQ_REMOVE(&ram_list.blocks, block, next);
ram_list.mru_block = NULL;
ram_list.version++;
- if (block->flags & RAM_PREALLOC_MASK) {
+ if (block->flags & RAM_PREALLOC) {
;
} else if (xen_enabled()) {
xen_invalidate_map_cache_entry(block->host);
@@ -1380,7 +1383,7 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t length)
offset = addr - block->offset;
if (offset < block->length) {
vaddr = block->host + offset;
- if (block->flags & RAM_PREALLOC_MASK) {
+ if (block->flags & RAM_PREALLOC) {
;
} else if (xen_enabled()) {
abort();
--
MST
- [Qemu-devel] [PULL 057/103] Add new vhost-user netdev backend, (continued)
- [Qemu-devel] [PULL 057/103] Add new vhost-user netdev backend, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 058/103] Add the vhost-user netdev backend to the command line, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 059/103] Add vhost-user protocol documentation, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 061/103] Add qtest for vhost-user, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 065/103] NUMA: convert -numa option to use OptsVisitor, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 066/103] NUMA: expand MAX_NODES from 64 to 128, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 067/103] man: improve -numa doc, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 069/103] numa: introduce memory_region_allocate_system_memory, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 070/103] memory: reorganize file-based allocation, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 071/103] memory: move preallocation code out of exec.c, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 072/103] memory: move RAM_PREALLOC_MASK to exec.c, rename,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 073/103] configure: add Linux libnuma detection, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 074/103] Introduce signed range., Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 075/103] qom: introduce object_property_get_enum and object_property_get_uint16List, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 076/103] numa: add -numa node,memdev= option, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 078/103] memory: add error propagation to file-based RAM allocation, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 079/103] vl: redo -object parsing, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 080/103] pc: pass MachineState to pc_memory_init, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 081/103] backend:hostmem: replace hostmemory with host_memory, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 082/103] hostmem: separate allocation from UserCreatable complete method, Michael S. Tsirkin, 2014/06/17