Received: from eggs.gnu.org ([2001:4830:134:3::10]:45969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS5GR-0006om-Jv for qemu-devel@nongnu.org; Thu, 11 Sep 2014 10:22:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XS5GL-0007tW-BY for qemu-devel@nongnu.org; Thu, 11 Sep 2014 10:22:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS5GL-0007tA-3S for qemu-devel@nongnu.org; Thu, 11 Sep 2014 10:22:17 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8BEMFS7024444 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 11 Sep 2014 10:22:16 -0400 Date: Thu, 11 Sep 2014 16:22:13 +0200 From: Kevin Wolf Message-ID: <20140911142213.GE3891@noname.redhat.com> References: <1410439779-20402-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1410439779-20402-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH] dataplane: fix virtio_blk_data_plane_create() op blocker error path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Fam Zheng , qemu-devel@nongnu.org Am 11.09.2014 um 14:49 hat Stefan Hajnoczi geschrieben: > Commit 3718d8ab65f68de2acccbe6a315907805f54e3cc ("block: Replace in_use > with operation blocker") broke the error path because it consumed > local_err instead of propagating it. > > The caller has no way to know that the function failed. This caused > virtio-blk to start "successfully" even though there was a fatal > dataplane error. > > Steps to reproduce: > > $ qemu-system-x86_64 -enable-kvm -object iothread,id=iothread0 \ > -drive if=none,id=drive0,file=a.img \ > (qemu) drive_mirror drive0 /tmp/foo.img > (qemu) device_add virtio-blk-pci,iothread=iothread0,drive=drive0 > > Expected result: > > Since the mirror block job is using drive0 it is not possible to start > virtio-blk data-plane. > > device_add fails and the PCI adapter is not added. > > Actual result: > > device_add completes and the PCI adapter is added. > > Cc: Fam Zheng > Signed-off-by: Stefan Hajnoczi Thanks, applied to the block branch. Kevin