Received: from eggs.gnu.org ([209.51.188.92]:47442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEZxX-0004Ma-1i for qemu-devel@nongnu.org; Thu, 11 Apr 2019 09:41:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEZxW-0001dR-3T for qemu-devel@nongnu.org; Thu, 11 Apr 2019 09:41:42 -0400 From: Alberto Garcia In-Reply-To: <1df28c23-7efe-310d-2955-432b9a4bb1ad@redhat.com> References: <1df28c23-7efe-310d-2955-432b9a4bb1ad@redhat.com> Date: Thu, 11 Apr 2019 15:41:38 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 13/13] qemu-iotests: Test the x-blockdev-reopen QMP command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf On Wed 10 Apr 2019 07:03:50 PM CEST, Max Reitz wrote: >> + # hd0 has no backing file: we can omit the 'backing' option >> + self.reopen(opts) > > [...] > >> + # Detach hd2 from hd0. >> + self.reopen(opts, {'backing': None}) >> + self.reopen(opts, {}, "backing is missing for 'hd0'") > > I don=E2=80=99t understand the second test. hd0 has no default backing f= ile > and it currently has no backing child attached to it. Why would this > call fail now? I think there's a bug. Calling x-blockdev-reopen without 'backing' should only fail if a) the image has a backing file attached to it. In this case it doesn't: we just detached it in the previous line. b) there's a default backing file written on the image header. In this case there isn't (hd0 is created without one in setUp()). So it should not fail. I think the bug is that the test for condition (b) in bdrv_reopen_prepare() that returns "backing is missing..." is using backing_file but it should use (correct me if I'm wrong) auto_backing_file. Changing that and replacing the test line with self.reopen(opts) fixes it for me. Not directly related to this, but should bdrv_backing_detach() also clear backing_file ? Berto