From patchwork Fri Oct 28 12:47:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9401933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C00ED60231 for ; Fri, 28 Oct 2016 12:50:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B14A12A703 for ; Fri, 28 Oct 2016 12:50:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A644F2A7F3; Fri, 28 Oct 2016 12:50:47 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 12ACC2A7F1 for ; Fri, 28 Oct 2016 12:50:46 +0000 (UTC) Received: from localhost ([::1]:48969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c06cP-0007hI-AU for patchwork-qemu-devel@patchwork.kernel.org; Fri, 28 Oct 2016 08:50:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c06bu-0007fN-EA for qemu-devel@nongnu.org; Fri, 28 Oct 2016 08:50:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c06bt-0003Fh-GW for qemu-devel@nongnu.org; Fri, 28 Oct 2016 08:50:14 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:36108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c06bt-0003Dq-7y; Fri, 28 Oct 2016 08:50:13 -0400 Received: by mail-pf0-x243.google.com with SMTP id n85so1238859pfi.3; Fri, 28 Oct 2016 05:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SCNuE2XDbkXJY5Zn3JO1uqCdVVQ9wSsMmrZw7Ze//64=; b=l+0gr2G3CHcB/yrcZftha3mOMvNUBCHwVF54qmDB7ACcoQujEuRj7J3B78rb/ZDgsr nSdvHad+6wAtz8UQOerr9j6WqYBGbm5OpFVcln8xoZxACGhKtLNzo7tEpZrIlyVuzaxy uUDRMp9q2wH4nmKuclmiE/JgkbuDWjzIqsBxTo2yHx3hNVA0NseztAlVC7HC0hPtj7Rz 1IMrPyd2t8bPeSx/3jV4ofnbpUt7AY3km5M6OodYA4sRt4Aq0po3D3E3s/xsnDApsWdV 8v1nIOGx+oRGNMtmQNMUZXX4WE4kqvyIYe38Rq/KlejzLvKP2FIGQDSqYKGeeND7fx1R 9RRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SCNuE2XDbkXJY5Zn3JO1uqCdVVQ9wSsMmrZw7Ze//64=; b=Tyu/UYaYvrr5pKUWtpH/rJlrlLknXFcdjGVRRnR0GUNWxUd0th4boWcTToTnHUtvbG Z9qbndVRyyfEvvicnOcI+o8UY01+4eWD0P+RJsit1UEKaMn/npZOtGgE/zRhlqna76vK OzZDkylVhQ+w5hoJr2kcdxkWOWI+gSEPGm6Jb58HBJhNaFZxBW+I7yCxpWB9ZOGuNyKs Fg7bFVM17wwXmW1G38k+j7EeHnGho8PTDK4YFSxvXgslvGunrzmUXPd+7vxg2/0Aq9rQ w2ZheUwqANzXZkVunw0LIlu4DLQtbVXSxMLFPaKUUrChEpJyVehR/zGZKus8QovYXzEd bYxw== X-Gm-Message-State: ABUngvddPhG9pIOjUFFWLFIrOCDtXxRjJ6h9cZqEt/fhcyymyJXXkn44iQYtBBiFadMgoA== X-Received: by 10.98.129.130 with SMTP id t124mr24514442pfd.5.1477659011622; Fri, 28 Oct 2016 05:50:11 -0700 (PDT) Received: from linux.local ([47.247.108.77]) by smtp.gmail.com with ESMTPSA id u127sm18951598pfu.21.2016.10.28.05.50.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Oct 2016 05:50:11 -0700 (PDT) From: Ashijeet Acharya To: kwolf@redhat.com Date: Fri, 28 Oct 2016 18:17:06 +0530 Message-Id: <1477658826-7181-3-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1477658826-7181-1-git-send-email-ashijeetacharya@gmail.com> References: <1477658826-7181-1-git-send-email-ashijeetacharya@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [PATCH v4 2/2] qapi: allow blockdev-add for NFS 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: qemu-block@nongnu.org, jcody@redhat.com, pl@kamp.de, qemu-devel@nongnu.org, armbru@redhat.com, Ashijeet Acharya , mreitz@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Introduce new object 'BlockdevOptionsNFS' in qapi/block-core.json to support blockdev-add for NFS network protocol driver. Also make a new struct NFSServer to support tcp connection. Signed-off-by: Ashijeet Acharya --- qapi/block-core.json | 77 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 73 insertions(+), 4 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 9d797b8..c8bc6d7 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1708,15 +1708,16 @@ # # @host_device, @host_cdrom: Since 2.1 # @gluster: Since 2.7 +# @nfs: Since 2.8 # # Since: 2.0 ## { 'enum': 'BlockdevDriver', 'data': [ 'archipelago', 'blkdebug', 'blkverify', 'bochs', 'cloop', 'dmg', 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom', - 'host_device', 'http', 'https', 'luks', 'null-aio', 'null-co', - 'parallels', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', - 'replication', 'tftp', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } + 'host_device', 'http', 'https', 'luks', 'nfs', 'null-aio', + 'null-co', 'parallels', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', + 'replication', 'tftp', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } ## # @BlockdevOptionsFile @@ -2212,6 +2213,74 @@ '*top-id': 'str' } } ## +# @NFSTransport +# +# An enumeration of NFS transport types +# +# @inet: TCP transport +# +# Since 2.8 +## +{ 'enum': 'NFSTransport', + 'data': [ 'inet' ] } + +## +# @NFSServer +# +# Captures the address of the socket +# +# @type: transport type used for NFS (only TCP supported) +# +# @host: host address for NFS server +# +# Since 2.8 +## +{ 'struct': 'NFSServer', + 'data': { 'type': 'NFSTransport', + 'host': 'str' } } + +## +# @BlockdevOptionsNfs +# +# Driver specific block device option for NFS +# +# @server: host address +# +# @path: path of the image on the host +# +# @user: #optional UID value to use when talking to the +# server (defaults to 65534 on Windows and getuid() +# on unix) +# +# @group: #optional GID value to use when talking to the +# server (defaults to 65534 on Windows and getgid() +# in unix) +# +# @tcp-syn-count: #optional number of SYNs during the session +# establishment (defaults to libnfs default) +# +# @readahead-size: #optional set the readahead size in bytes (defaults +# to libnfs default) +# +# @page-cache-size: #optional set the pagecache size in bytes (defaults +# to libnfs default) +# +# @debug-level: #optional set the NFS debug level (max 2) (defaults +# to libnfs default) +# +# Since 2.8 +## +{ 'struct': 'BlockdevOptionsNfs', + 'data': { 'server': 'NFSServer', + 'path': 'str', + '*user': 'int', + '*group': 'int', + '*tcp-syn-count': 'int', + '*readahead-size': 'int', + '*page-cache-size': 'int', + '*debug-level': 'int' } } + +## # @BlockdevOptionsCurl # # Driver specific block device options for the curl backend. @@ -2269,7 +2338,7 @@ # TODO iscsi: Wait for structured options 'luks': 'BlockdevOptionsLUKS', # TODO nbd: Should take InetSocketAddress for 'host'? -# TODO nfs: Wait for structured options + 'nfs': 'BlockdevOptionsNfs', 'null-aio': 'BlockdevOptionsNull', 'null-co': 'BlockdevOptionsNull', 'parallels': 'BlockdevOptionsGenericFormat',