From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: mtosatti@redhat.com, borntraeger@de.ibm.com, pbonzini@redhat.com,
agraf@suse.de, stefano.stabellini@eu.citrix.com
Subject: [Qemu-devel] [PATCH RFC 2/8] exec: Clean up fall back when -mem-path allocation fails
Date: Thu, 13 Jun 2013 09:02:13 +0200 [thread overview]
Message-ID: <1371106939-6968-3-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1371106939-6968-1-git-send-email-armbru@redhat.com>
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 incommit
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.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
exec.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/exec.c b/exec.c
index b424e12..56c31a9 100644
--- a/exec.c
+++ b/exec.c
@@ -1091,15 +1091,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
next prev parent reply other threads:[~2013-06-13 7:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 7:02 [Qemu-devel] [PATCH RFC 0/8] Guest memory allocation fixes & cleanup Markus Armbruster
2013-06-13 7:02 ` [Qemu-devel] [PATCH RFC 1/8] exec: Fix Xen RAM allocation with unusual options Markus Armbruster
2013-06-13 11:54 ` Stefano Stabellini
2013-06-13 7:02 ` Markus Armbruster [this message]
2013-06-13 22:12 ` [Qemu-devel] [PATCH RFC 2/8] exec: Clean up fall back when -mem-path allocation fails Paolo Bonzini
2013-06-13 7:02 ` [Qemu-devel] [PATCH RFC 3/8] exec: Reduce ifdeffery around -mem-path Markus Armbruster
2013-06-13 7:02 ` [Qemu-devel] [PATCH RFC 4/8] s390: Simplify the RAM allocation hook Markus Armbruster
2013-06-13 8:19 ` Andreas Färber
2013-06-13 22:14 ` Paolo Bonzini
2013-06-13 7:02 ` [Qemu-devel] [PATCH RFC 5/8] s390: Make qemu_ram_remap() consistent with allocation Markus Armbruster
2013-06-13 22:19 ` Paolo Bonzini
2013-06-13 7:02 ` [Qemu-devel] [PATCH RFC 6/8] exec: Clean up unnecessary S390 ifdeffery Markus Armbruster
2013-06-13 22:21 ` Paolo Bonzini
2013-06-14 8:06 ` Markus Armbruster
2013-06-15 17:26 ` Paolo Bonzini
2013-06-13 7:02 ` [Qemu-devel] [PATCH RFC 7/8] exec: Don't abort when we can't allocate guest memory Markus Armbruster
2013-06-13 8:33 ` Andreas Färber
2013-06-13 16:02 ` Richard Henderson
2013-06-13 17:27 ` Markus Armbruster
2013-06-13 16:21 ` Peter Maydell
2013-06-13 17:27 ` Markus Armbruster
2013-06-13 7:02 ` [Qemu-devel] [PATCH RFC 8/8] pc_sysfw: Fix ISA BIOS init for ridiculously big flash Markus Armbruster
2013-06-13 7:05 ` [Qemu-devel] [PATCH RFC 0/8] Guest memory allocation fixes & cleanup Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371106939-6968-3-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).