From patchwork Thu Apr 4 13:20:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 10885603 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 E987D1708 for ; Thu, 4 Apr 2019 13:22:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE52A286C0 for ; Thu, 4 Apr 2019 13:22:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C15D2286D6; Thu, 4 Apr 2019 13:22:16 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E9DF286C0 for ; Thu, 4 Apr 2019 13:22:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728876AbfDDNWO (ORCPT ); Thu, 4 Apr 2019 09:22:14 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60196 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727053AbfDDNWO (ORCPT ); Thu, 4 Apr 2019 09:22:14 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 274C6A78; Thu, 4 Apr 2019 06:22:14 -0700 (PDT) Received: from ostrya.cambridge.arm.com (ostrya.cambridge.arm.com [10.1.196.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5E60B3F68F; Thu, 4 Apr 2019 06:22:13 -0700 (PDT) From: Jean-Philippe Brucker To: Will.Deacon@arm.com Cc: Andre.Przywara@arm.com, kvm@vger.kernel.org Subject: [PATCH kvmtool v2 0/9] Disk fixes and AIO reset Date: Thu, 4 Apr 2019 14:20:41 +0100 Message-Id: <20190404132050.37309-1-jean-philippe.brucker@arm.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Changes since v1 [1]: * Added review tags * Fixed lkvm-static build, using $(OBJS_STATOPT/DYNOPT) in the makefile rather than $(OBJS). Patches 1-7 fix a few issues found while testing disk backends, and patches 8-9 implement reset for the AIO backend. By draining the AIO queue on reset, we avoid writing I/O completions to the used ring after the guest reclaimed the ring's pages. [1] https://www.spinics.net/lists/kvm/msg182324.html Jean-Philippe Brucker (9): qcow: Fix qcow1 exit fault virtio/blk: Set VIRTIO_BLK_F_RO when the disk is read-only guest: sync disk before shutting down disk/aio: Refactor AIO code disk/aio: Fix use of disk->async disk/aio: Fix AIO thread disk/aio: Cancel AIO thread on cleanup disk/aio: Add wait() disk operation virtio/blk: sync I/O on reset Makefile | 2 + disk/aio.c | 150 +++++++++++++++++++++++++++++++++++++++ disk/blk.c | 10 +-- disk/core.c | 69 ++++++++---------- disk/qcow.c | 3 +- disk/raw.c | 56 +++------------ guest/init.c | 1 + include/kvm/disk-image.h | 53 ++++++++++++-- include/kvm/read-write.h | 11 --- util/read-write.c | 36 ---------- virtio/blk.c | 7 +- 11 files changed, 249 insertions(+), 149 deletions(-) create mode 100644 disk/aio.c