From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZD5my-0005JQ-6G for qemu-devel@nongnu.org; Thu, 09 Jul 2015 02:58:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZD5mu-0007Ax-5w for qemu-devel@nongnu.org; Thu, 09 Jul 2015 02:58:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZD5mu-0007Ak-0u for qemu-devel@nongnu.org; Thu, 09 Jul 2015 02:58:28 -0400 Date: Thu, 9 Jul 2015 09:58:23 +0300 From: "Michael S. Tsirkin" Message-ID: <20150709095607-mutt-send-email-mst@redhat.com> References: <1436348808-223033-1-git-send-email-imammedo@redhat.com> <1436348808-223033-8-git-send-email-imammedo@redhat.com> <20150708165837.62857513@igors-macbook-pro.local> <20150708202834-mutt-send-email-mst@redhat.com> <20150708204143.7a808abd@igors-macbook-pro.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150708204143.7a808abd@igors-macbook-pro.local> Subject: Re: [Qemu-devel] [RFC v3 7/8] memory: extend memory_region_add_subregion() to support error reporting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Peter Maydell , QEMU Developers , Paolo Bonzini On Wed, Jul 08, 2015 at 08:41:43PM +0200, Igor Mammedov wrote: > On Wed, 8 Jul 2015 20:30:42 +0300 > "Michael S. Tsirkin" wrote: > > > On Wed, Jul 08, 2015 at 04:58:37PM +0200, Igor Mammedov wrote: > > > On Wed, 8 Jul 2015 12:09:10 +0100 > > > Peter Maydell wrote: > > > > > > > On 8 July 2015 at 10:46, Igor Mammedov > > > > wrote: > > > > > extends memory_region_add_subregion() by adding Error** > > > > > argument to allow t fail and return a error from it. > > > > > > > > > > Signed-off-by: Igor Mammedov > > > > > 156 files changed, 619 insertions(+), 420 deletions(-) > > > > > > > > This is a seriously invasive API change and I don't > > > > really like it -- reconfiguring the memory region > > > > hierarchy should not be an operation which can fail > > > > (especially not just adding a subregion!) > > > > > > > > -- PMM > > > > > > > > > > I'll drop this patch in favor of dedicated > > > memory_region_add_subregion_to_hva() API that can fail and return > > > error. > > > > Personally, I think it would be better to have an API that gets > > a hva and a callback to invoke before releasing MR. > > > > It's just a question of taste though. > > > > that won't handle check at subregion_add time if region is available > and error out if it's. The point is that you request a hva range *before* adding regions. Then pass it in. -- MST