Received: from eggs.gnu.org ([208.118.235.92]:51521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULCts-0001gT-OB for qemu-devel@nongnu.org; Thu, 28 Mar 2013 09:29:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULCtq-00015Y-E6 for qemu-devel@nongnu.org; Thu, 28 Mar 2013 09:29:52 -0400 Received: from mail-wg0-f54.google.com ([74.125.82.54]:49217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULCtq-00015J-7J for qemu-devel@nongnu.org; Thu, 28 Mar 2013 09:29:50 -0400 Received: by mail-wg0-f54.google.com with SMTP id a12so1475311wgh.21 for ; Thu, 28 Mar 2013 06:29:49 -0700 (PDT) Date: Thu, 28 Mar 2013 14:29:47 +0100 From: Stefan Hajnoczi Message-ID: <20130328132947.GE22865@stefanha-thinkpad.redhat.com> References: <1364401698-21402-1-git-send-email-kwolf@redhat.com> <20130328105357.GB15114@stefanha-thinkpad.redhat.com> <20130328111339.GE3077@dhcp-200-207.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130328111339.GE3077@dhcp-200-207.str.redhat.com> Subject: Re: [Qemu-devel] [PATCH] block: Fix direct use of protocols as driver for bdrv_open() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: pl@dlhnet.de, qemu-devel@nongnu.org, stefanha@redhat.com On Thu, Mar 28, 2013 at 12:13:40PM +0100, Kevin Wolf wrote: > Am 28.03.2013 um 11:53 hat Stefan Hajnoczi geschrieben: > > On Wed, Mar 27, 2013 at 05:28:18PM +0100, Kevin Wolf wrote: > > > bdrv_open_common() implements direct use of protocols by copying the > > > pre-opened BlockDriverStates to bs using bdrv_swap(). It did however > > > first set some fields in bs, which end up in file after the swap. When > > > bdrv_open() destroys file, it appears to be open, and because it isn't, > > > qemu could segfault while trying to close it. > > > > > > Reorder the operations to return immediately in such cases so that file > > > is correctly detected as closed. > > > > > > Signed-off-by: Kevin Wolf > > > --- > > > block.c | 31 +++++++++++++++---------------- > > > 1 file changed, 15 insertions(+), 16 deletions(-) > > > > Didn't apply cleanly, please check that I resolved the conflict > > correctly. > > Sorry, my bad, this was accidentally on top of a temporary quick fix... > You conflict resolution is correct. Thanks. Stefan