From patchwork Tue Sep 12 07:56:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Changpeng" X-Patchwork-Id: 812235 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=) 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 3xrKWS4xNWz9s4q for ; Mon, 11 Sep 2017 17:37:08 +1000 (AEST) Received: from localhost ([::1]:55948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drJHD-0001Ey-KL for incoming@patchwork.ozlabs.org; Mon, 11 Sep 2017 03:37:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drJGV-0001DT-Es for qemu-devel@nongnu.org; Mon, 11 Sep 2017 03:36:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drJGS-0007dd-6m for qemu-devel@nongnu.org; Mon, 11 Sep 2017 03:36:19 -0400 Received: from mga05.intel.com ([192.55.52.43]:18824) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1drJGR-0007cA-TV for qemu-devel@nongnu.org; Mon, 11 Sep 2017 03:36:16 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP; 11 Sep 2017 00:36:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,376,1500966000"; d="scan'208";a="127495092" Received: from fedora.sh.intel.com ([10.67.112.210]) by orsmga004.jf.intel.com with ESMTP; 11 Sep 2017 00:35:59 -0700 From: Changpeng Liu To: changpeng.liu@intel.com, qemu-devel@nongnu.org Date: Tue, 12 Sep 2017 15:56:12 +0800 Message-Id: <1505202976-1784-1-git-send-email-changpeng.liu@intel.com> X-Mailer: git-send-email 1.9.3 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.43 Subject: [Qemu-devel] [PATCH v3 0/4] *** Introduce a new vhost-user-blk host device to Qemu *** 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: james.r.harris@intel.com, mst@redhat.com, stefanha@gmail.com, pbonzini@redhat.com, felipe@nutanix.com, marcandre.lureau@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Although virtio scsi specification was designed as a replacement for virtio_blk, there are still many users using virtio_blk. Qemu 2.9 introduced a new device vhost user scsi which can process I/O in user space for virtio_scsi, this commit introduces a new vhost user block host device, which can support virtio_blk in Guest OS, and I/O processing in another I/O target. Due to the limitation for virtio_blk specification, virtio_blk device cannot get block information such as capacity, block size etc via the specification, several new vhost user messages were added to support deliver virtio config space information between Qemu and I/O target, VHOST_USER_GET_CONFIG/VHOST_USER_SET_CONFIG messages used for get/set config space from/to I/O target, VHOST_USER_SET_CONFIG_FD was added for event notifier in case the change of virtio config space. Also, those messages can be used for vhost device live migration as well. Changpeng Liu (4): vhost-user: add new vhost user messages to support virtio config space vhost-user-blk: introduce a new vhost-user-blk host device contrib/libvhost-user: enable virtio config space messages contrib/vhost-user-blk: introduce a vhost-user-blk sample application .gitignore | 1 + Makefile | 3 + Makefile.objs | 2 + configure | 11 + contrib/libvhost-user/libvhost-user.c | 74 ++++ contrib/libvhost-user/libvhost-user.h | 15 + contrib/vhost-user-blk/Makefile.objs | 1 + contrib/vhost-user-blk/vhost-user-blk.c | 735 ++++++++++++++++++++++++++++++++ docs/interop/vhost-user.txt | 32 ++ hw/block/Makefile.objs | 3 + hw/block/vhost-user-blk.c | 360 ++++++++++++++++ hw/virtio/vhost-user.c | 97 +++++ hw/virtio/vhost.c | 63 +++ hw/virtio/virtio-pci.c | 55 +++ hw/virtio/virtio-pci.h | 18 + include/hw/virtio/vhost-backend.h | 8 + include/hw/virtio/vhost-user-blk.h | 40 ++ include/hw/virtio/vhost.h | 16 + 18 files changed, 1534 insertions(+) create mode 100644 contrib/vhost-user-blk/Makefile.objs create mode 100644 contrib/vhost-user-blk/vhost-user-blk.c create mode 100644 hw/block/vhost-user-blk.c create mode 100644 include/hw/virtio/vhost-user-blk.h