From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yi2mo-0008Dg-7q for qemu-devel@nongnu.org; Tue, 14 Apr 2015 11:30:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yi2mk-0005Ea-89 for qemu-devel@nongnu.org; Tue, 14 Apr 2015 11:30:02 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:32915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yi2mk-0005EW-1x for qemu-devel@nongnu.org; Tue, 14 Apr 2015 11:29:58 -0400 Received: by wiax7 with SMTP id x7so91357224wia.0 for ; Tue, 14 Apr 2015 08:29:57 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 14 Apr 2015 17:29:47 +0200 Message-Id: <1429025387-11077-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH] m25p80: add missing blk_attach_dev_nofail List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Crosthwaite , armbru@redhat.com, Stefan Hajnoczi Of the block devices that poked into -drive options via drive_get_next, m25p80 was the only one who also did not attach itself to the BlockBackend. Since sd does it, and all other devices go through a "drive" property, with this change all block backends attached to the guest will have a non-NULL result for blk_get_attached_dev(). Signed-off-by: Paolo Bonzini --- hw/block/m25p80.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index afe243b..728e384 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@ -629,6 +629,7 @@ static int m25p80_init(SSISlave *ss) if (dinfo) { DB_PRINT_L(0, "Binding to IF_MTD drive\n"); s->blk = blk_by_legacy_dinfo(dinfo); + blk_attach_dev_nofail(s->blk, s); /* FIXME: Move to late init */ if (blk_read(s->blk, 0, s->storage, -- 2.3.5