From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdUao-0001vp-Mu for qemu-devel@nongnu.org; Mon, 04 Nov 2013 19:34:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdUah-0007qk-1F for qemu-devel@nongnu.org; Mon, 04 Nov 2013 19:34:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdUag-0007qW-PC for qemu-devel@nongnu.org; Mon, 04 Nov 2013 19:33:54 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA50XsrV005710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 4 Nov 2013 19:33:54 -0500 Message-ID: <52783CEE.2020808@redhat.com> Date: Tue, 05 Nov 2013 01:33:50 +0100 From: Max Reitz MIME-Version: 1.0 References: <1383611413-21528-1-git-send-email-mreitz@redhat.com> In-Reply-To: <1383611413-21528-1-git-send-email-mreitz@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] block/drive-mirror: Check for NULL backing_hd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz On 05.11.2013 01:30, Max Reitz wrote: > It should be possible to execute the QMP "drive-mirror" command in > "none" sync mode and "absolute-paths" mode even for block devices > lacking a backing file. > > "absolute-paths" does in fact not require a backing file to be present, > as can be seen from the "top" sync mode code path. "top" basically > states that the device should indeed have a backing file - however, the > current code catches the case if it doesn't and then simply treats it as > "full" sync mode, creating a target image without a backing file (in > "absolute-paths" mode). Thus, "absolute-paths" does not imply the target > file must indeed have a backing file. > > Therefore, the target file may be left unbacked in case of "none" sync > mode as well, if the specified device is not backed either. Currently, > qemu will crash trying to dereference the backing file pointer since it > assumes that it will always be non-NULL in that case ("none" with > "absolute-paths"). > > Signed-off-by: Max Reitz > --- Sorry, forgot the cover letter, will send a v2. Max