From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnFl5-0003kt-Al for qemu-devel@nongnu.org; Thu, 13 Jun 2013 18:12:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnFl4-0006s2-Ek for qemu-devel@nongnu.org; Thu, 13 Jun 2013 18:12:43 -0400 Received: from mail-qa0-x229.google.com ([2607:f8b0:400d:c00::229]:36010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnFl4-0006rq-3g for qemu-devel@nongnu.org; Thu, 13 Jun 2013 18:12:42 -0400 Received: by mail-qa0-f41.google.com with SMTP id f14so1395189qak.7 for ; Thu, 13 Jun 2013 15:12:41 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51BA43D6.6030400@redhat.com> Date: Thu, 13 Jun 2013 18:12:38 -0400 From: Paolo Bonzini MIME-Version: 1.0 References: <1371106939-6968-1-git-send-email-armbru@redhat.com> <1371106939-6968-3-git-send-email-armbru@redhat.com> In-Reply-To: <1371106939-6968-3-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC 2/8] exec: Clean up fall back when -mem-path allocation fails List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: borntraeger@de.ibm.com, mtosatti@redhat.com, qemu-devel@nongnu.org, stefano.stabellini@eu.citrix.com, agraf@suse.de Il 13/06/2013 03:02, Markus Armbruster ha scritto: > 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 > --- > 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); > Reviewed-by: Paolo Bonzini