From patchwork Tue Jan 22 15:53:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 10776247 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 B54446C2 for ; Tue, 22 Jan 2019 20:47:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A58A92B885 for ; Tue, 22 Jan 2019 20:47:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9965C2B896; Tue, 22 Jan 2019 20:47:42 +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 C55B82B885 for ; Tue, 22 Jan 2019 20:47:40 +0000 (UTC) Received: from localhost ([127.0.0.1]:49413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm2xQ-0008D6-41 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Jan 2019 15:47:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gm1wT-0008WJ-39 for qemu-devel@nongnu.org; Tue, 22 Jan 2019 14:42:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gm1wS-0001a2-6Y for qemu-devel@nongnu.org; Tue, 22 Jan 2019 14:42:37 -0500 Received: from fanzine.igalia.com ([91.117.99.155]:58088) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gm1wR-0001Xw-Qm; Tue, 22 Jan 2019 14:42:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Message-Id:Date:Subject:Cc:To:From; bh=sF7jBRcO4MxNTpOzEc9kJY6ZlylPooKJ51YIP7UqPuc=; b=IKlSwZ2dfj1PdU8e3bhvVscVOrczbS3yk095y6AkFvhOMjcK8himI3Lz1pL5/46K5EcBxAz9p1gB0BOnnW216S35cQY+VfInNdsBltE3ZMZsBrN5VE0dv9vczIsMav//olUaYd1OZz5xaEd8jKG1hf8dsxJFt2cooUHHp89epoP2Lbq0Rfv4157bJ+NLzyhZqapqU2EphFa1CcGTNymtNCK3h9iZlpUCBv2xem3dwD1NqKGC+jpkdguUHC4kY2d9uBSw6JJGzlYJe1ZtgSMtPdTj/Mddpz2fWLjTX5h9+XVVsWGQvaSOUQfLYd9hL3zo0lYMdM3eODqlf9ZglArMKQ==; 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 1glyN1-0003Uj-99; Tue, 22 Jan 2019 16:53:47 +0100 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1glyMl-0003ov-Jn; Tue, 22 Jan 2019 17:53:31 +0200 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Tue, 22 Jan 2019 17:53:20 +0200 Message-Id: X-Mailer: git-send-email 2.11.0 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 0/3] iothread-related fixes for virtio-scsi 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 Hi, here are three patches with iothread-related fixes for virtio-scsi, with their test cases. This series fixes the following bugs: https://bugzilla.redhat.com/show_bug.cgi?id=1656276 https://bugzilla.redhat.com/show_bug.cgi?id=1662508 I also wanted to do prepare a similar one for virtio-blk but I'm unsure about how to proceed, because I'm unable to detect during realize() that the blockdev is using a different iothread. This crashes QEMU: { "execute": "qmp_capabilities" } { "execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "hd0", "read-only": true}} { "execute": "object-add", "arguments": {"qom-type": "iothread", "id": "iothread0"}} { "execute": "object-add", "arguments": {"qom-type": "iothread", "id": "iothread1"}} { "execute": "device_add", "arguments": {"id": "virtio-blk0", "driver": "virtio-blk", "iothread": "iothread0", "drive": "hd0"}} { "execute": "system_reset"} (wait for the events) { "execute": "device_add", "arguments": {"id": "virtio-blk1", "driver": "virtio-blk", "iothread": "iothread1", "drive": "hd0"}} Regards, Berto Alberto Garcia (3): virtio-scsi: Move BlockBackend back to the main AioContext on unplug scsi-disk: Acquire the AioContext in scsi_*_realize() virtio-scsi: Forbid devices with different iothreads sharing a blockdev hw/scsi/scsi-disk.c | 23 ++++++-- hw/scsi/virtio-scsi.c | 13 +++++ tests/qemu-iotests/240 | 129 +++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/240.out | 54 +++++++++++++++++++ tests/qemu-iotests/group | 1 + 5 files changed, 217 insertions(+), 3 deletions(-) create mode 100755 tests/qemu-iotests/240 create mode 100644 tests/qemu-iotests/240.out