From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5y8E-00029S-QW for qemu-devel@nongnu.org; Mon, 07 Dec 2015 10:55:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5y89-0006kb-PC for qemu-devel@nongnu.org; Mon, 07 Dec 2015 10:55:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5y89-0006kF-KU for qemu-devel@nongnu.org; Mon, 07 Dec 2015 10:55:13 -0500 From: Markus Armbruster Date: Mon, 7 Dec 2015 16:55:10 +0100 Message-Id: <1449503710-3707-3-git-send-email-armbru@redhat.com> In-Reply-To: <1449503710-3707-1-git-send-email-armbru@redhat.com> References: <1449503710-3707-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH for-2.5 2/2] sd: Mark brittle abuse of blk_attach_dev() FIXME List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, crosthwaite.peter@gmail.com, kevin@koconnor.net, stefanha@redhat.com, pbonzini@redhat.com blk_attach_dev() fails here only when we're working for device "sdhci-pci" (which already attached the backend), and then we don't want to attach a second time. If we ever create another failure mode, we're setting up ourselves to using the same backend from multiple frontends, which is likely to end in tears. Can't clean this up this close to the release, so mark it FIXME. Signed-off-by: Markus Armbruster --- hw/sd/sd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index ce4d44b..1a9935c 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -494,6 +494,7 @@ SDState *sd_init(BlockBackend *blk, bool is_spi) if (sd->blk) { /* Attach dev if not already attached. (This call ignores an * error return code if sd->blk is already attached.) */ + /* FIXME ignoring blk_attach_dev() failure is dangerously brittle */ blk_attach_dev(sd->blk, sd); blk_set_dev_ops(sd->blk, &sd_block_ops, sd); } -- 2.4.3