[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 for 1.6 2/8] exec: Clean up fall back when -mem-p
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v3 for 1.6 2/8] exec: Clean up fall back when -mem-path allocation fails |
Date: |
Wed, 31 Jul 2013 15:11:06 +0200 |
With -mem-path, qemu_ram_alloc_from_ptr() first tries to allocate
accordingly, but when it fails, it falls back to normal allocation.
The fall back allocation code used to be effectively identical to the
"-mem-path not given" code, until it started to diverge in commit
432d268. I believe the code still works, but clean it up anyway: drop
the special fall back allocation code, and fall back to the ordinary
"-mem-path not given" code instead.
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
exec.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/exec.c b/exec.c
index 5b1be92..957266c 100644
--- a/exec.c
+++ b/exec.c
@@ -1129,15 +1129,12 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size,
void *host,
if (mem_path) {
#if defined (__linux__) && !defined(TARGET_S390X)
new_block->host = file_ram_alloc(new_block, size, mem_path);
- if (!new_block->host) {
- new_block->host = qemu_anon_ram_alloc(size);
- memory_try_enable_merging(new_block->host, size);
- }
#else
fprintf(stderr, "-mem-path option unsupported\n");
exit(1);
#endif
- } else {
+ }
+ if (!new_block->host) {
if (kvm_enabled()) {
/* some s390/kvm configurations have special constraints */
new_block->host = kvm_ram_alloc(size);
--
1.7.11.7
- [Qemu-devel] [PATCH v3 for 1.6 0/8] Guest memory allocation fixes & cleanup, Markus Armbruster, 2013/07/31
- [Qemu-devel] [PATCH v3 for 1.6 1/8] exec: Fix Xen RAM allocation with unusual options, Markus Armbruster, 2013/07/31
- [Qemu-devel] [PATCH v3 for 1.6 5/8] exec: Drop incorrect & dead S390 code in qemu_ram_remap(), Markus Armbruster, 2013/07/31
- [Qemu-devel] [PATCH v3 for 1.6 6/8] exec: Clean up unnecessary S390 ifdeffery, Markus Armbruster, 2013/07/31
- [Qemu-devel] [PATCH v3 for 1.6 2/8] exec: Clean up fall back when -mem-path allocation fails,
Markus Armbruster <=
- [Qemu-devel] [PATCH v3 for 1.6 4/8] exec: Simplify the guest physical memory allocation hook, Markus Armbruster, 2013/07/31
- [Qemu-devel] [PATCH v3 for 1.6 7/8] exec: Don't abort when we can't allocate guest memory, Markus Armbruster, 2013/07/31
- [Qemu-devel] [PATCH v3 for 1.6 8/8] pc_sysfw: Fix ISA BIOS init for ridiculously big flash, Markus Armbruster, 2013/07/31
- Re: [Qemu-devel] [PATCH v3 for 1.6 0/8] Guest memory allocation fixes & cleanup, Laszlo Ersek, 2013/07/31
- [Qemu-devel] [PATCH v3 for 1.6 3/8] exec: Reduce ifdeffery around -mem-path, Markus Armbruster, 2013/07/31