From patchwork Thu Jan 10 15:03:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 10756013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 175D013B5 for ; Thu, 10 Jan 2019 15:05:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0752F29960 for ; Thu, 10 Jan 2019 15:05:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF59A29A23; Thu, 10 Jan 2019 15:05:33 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A7E5129960 for ; Thu, 10 Jan 2019 15:05:33 +0000 (UTC) Received: from localhost ([127.0.0.1]:44589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbtl-0004EG-0O for patchwork-qemu-devel@patchwork.kernel.org; Thu, 10 Jan 2019 10:05:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbsH-00030l-C6 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 10:04:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbsG-0007OW-H1 for qemu-devel@nongnu.org; Thu, 10 Jan 2019 10:04:01 -0500 Received: from fanzine.igalia.com ([91.117.99.155]:57864) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ghbsF-0007ND-TM; Thu, 10 Jan 2019 10:04:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=L9HmUY97OyxWpLBVGHyd1eTDvesw+Ee02jTzh2ZhCVw=; b=DVEIxDbQ8sOQc/VwIy/hKGboPcfncvAf190dawMLxCkzOdHd4QQZByTILwsltZ8P1ekDSLmoDOLMNaCM8QXH30oMRyOmngraAe7vZr68hTo7n4HTl0Te5Ykq45/FtRTB5qjWOQ9D9tYwHDrZd1fxr/gLggDRpuZ5/QYr9swaIl3gZELwGyshrVPf07u+zWbsE2XxrlUKOycPJ/rW//F0iICBsaEWib8UN9zBuTvHTMN1YVZnUf8t1t1YFVnNj4WmcY9E/ArYl2sg4/NZ6LHS/lAm3Gq1xpm2/CDCrDBh6/lkgA9OsNG8H2EOVqu+aQ+KdIevu+aOYPCpHIy6uvetYQ==; Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1ghbsD-0003mY-O5; Thu, 10 Jan 2019 16:03:57 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1ghbry-0002Bq-9N; Thu, 10 Jan 2019 17:03:42 +0200 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 17:03:40 +0200 Message-Id: <485e041662e587923855fdc037c88556ce6ea5d1.1547132561.git.berto@igalia.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH 6/6] block: Acquire the AioContext in usb_msd_storage_realize() 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: , Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Max Reitz , Stefan Hajnoczi , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Alberto Garcia --- hw/usb/dev-storage.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index cd5551d94f..fa6e552f0f 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -593,13 +593,18 @@ static void usb_msd_storage_realize(USBDevice *dev, Error **errp) MSDState *s = USB_STORAGE_DEV(dev); BlockBackend *blk = s->conf.blk; SCSIDevice *scsi_dev; + AioContext *ctx; if (!blk) { error_setg(errp, "drive property not set"); return; } + ctx = blk_get_aio_context(blk); + aio_context_acquire(ctx); blkconf_blocksizes(&s->conf); + aio_context_release(ctx); + if (!blkconf_apply_backend_options(&s->conf, blk_is_read_only(blk), true, errp)) { return;