Received: from eggs.gnu.org ([2001:4830:134:3::10]:43016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnBIy-0000Vi-EJ for qemu-devel@nongnu.org; Thu, 13 Jun 2013 13:27:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnBIu-00070W-AC for qemu-devel@nongnu.org; Thu, 13 Jun 2013 13:27:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnBIu-00070Q-2G for qemu-devel@nongnu.org; Thu, 13 Jun 2013 13:27:20 -0400 From: Markus Armbruster References: <1371106939-6968-1-git-send-email-armbru@redhat.com> <1371106939-6968-8-git-send-email-armbru@redhat.com> <51B9ED17.4060305@twiddle.net> Date: Thu, 13 Jun 2013 19:27:13 +0200 In-Reply-To: <51B9ED17.4060305@twiddle.net> (Richard Henderson's message of "Thu, 13 Jun 2013 09:02:31 -0700") Message-ID: <87obb9ly4u.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH RFC 7/8] exec: Don't abort when we can't allocate guest memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: stefano.stabellini@eu.citrix.com, mtosatti@redhat.com, agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, pbonzini@redhat.com Richard Henderson writes: > On 06/13/2013 12:02 AM, Markus Armbruster wrote: >> @@ -945,7 +952,7 @@ static void *file_ram_alloc(RAMBlock *block, >> area = mmap(0, memory, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); >> #endif >> if (area == MAP_FAILED) { >> - perror("file_ram_alloc: can't mmap RAM pages"); >> + no_guest_mem(block); >> close(fd); >> return (NULL); >> } > > Dead code after no_guest_mem. Right you are. Before: if allocation obeying -mem-path fails, we retry without -mem-path. Some failures are silent. After: if mmap() fails, we give up. Functional change not mentioned in commit message. I'll either revert it or document it. I'm not sure falling back to non-mem-path allocation is a good idea in all failure cases. Thanks!