From patchwork Wed Jan 17 11:25:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 862223 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LCrXg/JB"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zM4Zn5cvNz9rxj for ; Wed, 17 Jan 2018 22:28:01 +1100 (AEDT) Received: from localhost ([::1]:56695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eblst-0001zk-QT for incoming@patchwork.ozlabs.org; Wed, 17 Jan 2018 06:27:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eblqO-0000Pv-8D for qemu-devel@nongnu.org; Wed, 17 Jan 2018 06:25:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eblqJ-0003kx-9n for qemu-devel@nongnu.org; Wed, 17 Jan 2018 06:25:24 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:33633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eblqI-0003ia-QX; Wed, 17 Jan 2018 06:25:19 -0500 Received: by mail-wr0-x241.google.com with SMTP id p6so18490528wrd.0; Wed, 17 Jan 2018 03:25:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dqjCu4oW7a+pkCIzHZEkEIgA2r6Ym6YeJUUGX0N9xp0=; b=LCrXg/JBxewLm2pC+JDWbR58MmmdSfhTTMMYdLq+BnjjuYWa4QYVtzAQB2uHSXVRHO 8lNX+2K0jNWf0y97H3MJJoWbz92VSFGrMxLAMqwgCU3gMh3oGsi44iw9SdNOwpePwlf+ c4PVdhJjrCjEQkwHrIXV1V16zVQ31wbQU+cfcwSAQUxM0QosZahDvrrn1NiUmVwsDy84 D3Mv3R4QhH22O8NmI3/K15M92rCJWycojNv5HbVGyLb0+UNMkntkwIpGNfH/8FUSQxhB sMcNxSbKquMn8HX4xqGalbjgB8yQYDSokAZb2J0rBlIAokb9u0dHHOvzZOfhlZFhWC13 k2MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=dqjCu4oW7a+pkCIzHZEkEIgA2r6Ym6YeJUUGX0N9xp0=; b=rAuyx0pYuqsVcmi8eGVMEr/w7UZM9I4QGBKGFPndCmLzahho9vFrhjdapC0KQTNQLa KJSA2v9qmtY3qirSk1k59iupHH2d34oNbyW6pe3BKTL7ls4ukb+eIKk7eN4Bb6HrJsfr n8X3obuhhgni+jwUzAhmfJZJmgs4ZJoNLbRq8UJVMHUs7ZFIBMY8x3R6GrX/ED8w+oDn 5noxGA61IUexZs0h6VKmqNFTzH0ElGedhxxqSTXdbK3UZca1IidLSuYEU+zKDAzw2TzM Z1d6JF2Pd3Mkja8Qu9C/ZIyp4IA5bZ8ei5udT/So/csXJRDde6tZ1YRwgC6Ep5jTLFUD tqvw== X-Gm-Message-State: AKwxytededJpzWos1AV358B97Btcw3+6fFApMwiMjqMaGd6h0d4O0CZd BzUr/wnBwkiDUZ8Cox3DNGQIKTv0 X-Google-Smtp-Source: ACJfBov+W5AlOI/Bce60aCeA85XFrXZa9o/psaUbZEi/7yuBO8likM+FxXa3rvX/XMkkMY0YHlkRiQ== X-Received: by 10.223.157.4 with SMTP id k4mr2362892wre.273.1516188317390; Wed, 17 Jan 2018 03:25:17 -0800 (PST) Received: from 640k.lan (dynamic-adsl-78-12-229-84.clienti.tiscali.it. [78.12.229.84]) by smtp.gmail.com with ESMTPSA id w11sm2548965wrg.42.2018.01.17.03.25.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 03:25:16 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 17 Jan 2018 12:25:05 +0100 Message-Id: <1516188312-29612-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 0/7] Call check and invalidate_cache from coroutine context 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: kwolf@redhat.com, qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Check and invalidate_cache share some parts of the implementation with the regular I/O path. This is sometimes complicated because the I/O path wants to use a CoMutex but that is not possible outside coroutine context. By moving things to coroutine context, we can remove special cases. In fact, invalidate_cache is already called from coroutine context because incoming migration is placed in a coroutine. While at it, I'm including two patches from Stefan to rename the bdrv_create callback to bdrv_co_create, because it is already called from coroutine context. qcow2 still has cache flushing in non-coroutine context, coming from qcow2_reopen_prepare->qcow2_update_options_prepare and qcow2_close->qcow2_inactivate. Paolo v1->v2: fix file-win32 Paolo Bonzini (5): qcow2: make qcow2_do_open a coroutine_fn qed: make bdrv_qed_do_open a coroutine_fn block: convert bdrv_invalidate_cache callback to coroutine_fn qcow2: introduce qcow2_write_caches and qcow2_flush_caches block: convert bdrv_check callback to coroutine_fn Stefan Hajnoczi (2): block: rename .bdrv_create() to .bdrv_co_create() qcow2: make qcow2_co_create2() a coroutine_fn block.c | 88 ++++++++++++++++++++++++++++++---- block/crypto.c | 8 ++-- block/file-posix.c | 15 +++--- block/file-win32.c | 5 +- block/gluster.c | 12 ++--- block/iscsi.c | 13 ++--- block/nfs.c | 11 +++-- block/parallels.c | 23 +++++---- block/qcow.c | 5 +- block/qcow2-refcount.c | 28 +++++++++++ block/qcow2.c | 118 +++++++++++++++++++++++++++++++--------------- block/qcow2.h | 2 + block/qed-check.c | 1 + block/qed-table.c | 26 ++++------ block/qed.c | 72 +++++++++++++++++++++------- block/raw-format.c | 5 +- block/rbd.c | 12 +++-- block/sheepdog.c | 10 ++-- block/ssh.c | 5 +- block/vdi.c | 11 +++-- block/vhdx.c | 12 +++-- block/vmdk.c | 12 +++-- block/vpc.c | 5 +- include/block/block_int.h | 11 +++-- 24 files changed, 355 insertions(+), 155 deletions(-)