From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqffq-0006wA-50 for qemu-devel@nongnu.org; Tue, 18 Nov 2014 05:06:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xqffi-0002wl-TF for qemu-devel@nongnu.org; Tue, 18 Nov 2014 05:06:14 -0500 Received: from plane.gmane.org ([80.91.229.3]:34413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqffi-0002vr-Mu for qemu-devel@nongnu.org; Tue, 18 Nov 2014 05:06:06 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xqffi-0001IJ-1N for qemu-devel@nongnu.org; Tue, 18 Nov 2014 11:06:06 +0100 Received: from net-37-117-142-149.cust.vodafonedsl.it ([37.117.142.149]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Nov 2014 11:06:06 +0100 Received: from pbonzini by net-37-117-142-149.cust.vodafonedsl.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Nov 2014 11:06:06 +0100 From: Paolo Bonzini Date: Tue, 18 Nov 2014 11:05:52 +0100 Message-ID: <546B1A00.7030801@redhat.com> References: <1416259239-13281-1-git-send-email-dslutz@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit In-Reply-To: <1416259239-13281-1-git-send-email-dslutz@verizon.com> Subject: Re: [Qemu-devel] [BUGFIX][PATCH for 2.2 1/1] hw/ide/core.c: Prevent SIGSEGV during migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Stefano Stabellini On 17/11/2014 22:20, Don Slutz wrote: > The other callers to blk_set_enable_write_cache() in this file > already check for s->blk == NULL. > > Signed-off-by: Don Slutz > --- > > I think this is a bugfix that should be back ported to stable > releases. > > I also think this should be done in xen's copy of QEMU for 4.5 with > back port(s) to active stable releases. > > Note: In 2.1 and earlier the routine is > bdrv_set_enable_write_cache(); variable is s->bs. > > hw/ide/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/ide/core.c b/hw/ide/core.c > index 00e21cf..d4af5e2 100644 > --- a/hw/ide/core.c > +++ b/hw/ide/core.c > @@ -2401,7 +2401,7 @@ static int ide_drive_post_load(void *opaque, int version_id) > { > IDEState *s = opaque; > > - if (s->identify_set) { > + if (s->blk && s->identify_set) { > blk_set_enable_write_cache(s->blk, !!(s->identify_data[85] & (1 << 5))); > } > return 0; > Reviewed-by: Paolo Bonzini