From patchwork Wed Jul 18 21:12:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev\" via" X-Patchwork-Id: 10533279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EEB816020A for ; Wed, 18 Jul 2018 21:14:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAF9829B74 for ; Wed, 18 Jul 2018 21:14:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBE1C29B87; Wed, 18 Jul 2018 21:14:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 59F3329B74 for ; Wed, 18 Jul 2018 21:14:17 +0000 (UTC) Received: from localhost ([::1]:38327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fftm4-0005WP-Ja for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Jul 2018 17:14:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fftl7-0004vk-Sn for qemu-devel@nongnu.org; Wed, 18 Jul 2018 17:13:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fftl3-00072D-R5 for qemu-devel@nongnu.org; Wed, 18 Jul 2018 17:13:17 -0400 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:38828) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fftl3-00071g-Jt for qemu-devel@nongnu.org; Wed, 18 Jul 2018 17:13:13 -0400 Received: by mail-pl0-x244.google.com with SMTP id b1-v6so2584225pls.5 for ; Wed, 18 Jul 2018 14:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digitalocean.com; s=google; h=from:to:cc:subject:date:message-id; bh=1dBkOPFi6FEhesBSRBiYVxHgLIPtxqqQ+rmWsUjoPro=; b=c7kE026VTW5qsLXfgjof7bSRNC3ss+OrjumrdvBqDOIVSVjj/pkDF30cEgLeU1VGPd KJ0Ifr84TDfJwtMynt/8Z3Ovf0IeOa2PyeYZstwGm9BtEDIPYbtGgX2bshiy1yJ3iQ8F xTs5hrpMyWH4G2081dudOoHf7hn0GPeuZFKqo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=1dBkOPFi6FEhesBSRBiYVxHgLIPtxqqQ+rmWsUjoPro=; b=PdD7yK3OaPP3IZNzTZkNgzjtgd2eN0d9kHWG8nE9TzNg4qpJ1KB4DGZf8qAIi/DNWY KRR0B7vJdDbDZMkrr5qRxf4WeG2/pRtmXXtzYnQHHiflgW+1su+GmtvDMELN64PwMOaA CKfadEUT+alyFilfobhTJyxlStzLQNYhj9GZKJHsfhERAQJCSwSySYiJHG/ZmJbe3ywO VvqyrBb/yrgPFfE2T6QERMmEz9sookr+g4oGUAzc+hHkvMEBscYTXBfhCkr3fdawii4t h9pGBzhR4PBx/YyhJGPgWdLbQhU8ZIUqsC3qo/7z02dZCNfVwXjOz/oWP1mHLgi4mFqL gxAA== X-Gm-Message-State: AOUpUlEAYP9tfkyNU8YG0DaV5boqc0kF550oUOyqVvfxXVzZ8HhhNXaz BmlbGtK9IDf3NUDKJP5EuwHXrQ== X-Google-Smtp-Source: AAOMgpem/EDegYd/ySshTZ3b+Gg/OGCp78uA5n+VznwOhGcGtQswXJPpMm/V49pMALrCxqqmZ29Njg== X-Received: by 2002:a17:902:740b:: with SMTP id g11-v6mr7476722pll.85.1531948392584; Wed, 18 Jul 2018 14:13:12 -0700 (PDT) Received: from breakout.internal.digitalocean.com (97-120-191-226.ptld.qwest.net. [97.120.191.226]) by smtp.gmail.com with ESMTPSA id w11-v6sm6502363pgm.82.2018.07.18.14.13.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Jul 2018 14:13:11 -0700 (PDT) Received: by breakout.internal.digitalocean.com (Postfix, from userid 1000) id E669A8A2A5B; Wed, 18 Jul 2018 14:13:10 -0700 (PDT) To: naravamudan@digitalocean.com Date: Wed, 18 Jul 2018 14:12:56 -0700 Message-Id: <20180718211256.29774-1-naravamudan@digitalocean.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::244 Subject: [Qemu-devel] [PATCH] block/file-posix: add bdrv_attach_aio_context callback for host dev and cdrom X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nishanth Aravamudan via Qemu-devel From: "Denis V. Lunev\" via" Reply-To: Nishanth Aravamudan Cc: Kevin Wolf , Fam Zheng , qemu-block@nongnu.org, Farhan Ali , qemu-devel@nongnu.org, Max Reitz , Stefan Hajnoczi , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In ed6e2161 ("linux-aio: properly bubble up errors from initialzation"), I only added a bdrv_attach_aio_context callback for the bdrv_file driver. There are several other drivers that use the shared aio_plug callback, though, and they will trip the assertion added to aio_get_linux_aio because they did not call aio_setup_linux_aio first. Add the appropriate callback definition to the affected driver definitions. Fixes: ed6e2161 ("linux-aio: properly bubble up errors from initialization") Reported-by: Farhan Ali Signed-off-by: Nishanth Aravamudan Cc: Eric Blake Cc: Kevin Wolf Cc: John Snow Cc: Max Reitz Cc: Stefan Hajnoczi Cc: Fam Zheng Cc: Paolo Bonzini Cc: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org Reviewed-by: John Snow --- block/file-posix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index 60af4b3d51..ad299beb38 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -3158,6 +3158,7 @@ static BlockDriver bdrv_host_device = { .bdrv_refresh_limits = raw_refresh_limits, .bdrv_io_plug = raw_aio_plug, .bdrv_io_unplug = raw_aio_unplug, + .bdrv_attach_aio_context = raw_aio_attach_aio_context, .bdrv_co_truncate = raw_co_truncate, .bdrv_getlength = raw_getlength, @@ -3280,6 +3281,7 @@ static BlockDriver bdrv_host_cdrom = { .bdrv_refresh_limits = raw_refresh_limits, .bdrv_io_plug = raw_aio_plug, .bdrv_io_unplug = raw_aio_unplug, + .bdrv_attach_aio_context = raw_aio_attach_aio_context, .bdrv_co_truncate = raw_co_truncate, .bdrv_getlength = raw_getlength, @@ -3410,6 +3412,7 @@ static BlockDriver bdrv_host_cdrom = { .bdrv_refresh_limits = raw_refresh_limits, .bdrv_io_plug = raw_aio_plug, .bdrv_io_unplug = raw_aio_unplug, + .bdrv_attach_aio_context = raw_aio_attach_aio_context, .bdrv_co_truncate = raw_co_truncate, .bdrv_getlength = raw_getlength,