From patchwork Fri Oct 28 17:09:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9402425 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 A58B6601C0 for ; Fri, 28 Oct 2016 17:13:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9308121BED for ; Fri, 28 Oct 2016 17:13:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86BD02A8B4; Fri, 28 Oct 2016 17:13:49 +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 2C00621BED for ; Fri, 28 Oct 2016 17:13:49 +0000 (UTC) Received: from localhost ([::1]:50838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0Aiy-0006EF-Dz for patchwork-qemu-devel@patchwork.kernel.org; Fri, 28 Oct 2016 13:13:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0Ahr-0005f3-8d for qemu-devel@nongnu.org; Fri, 28 Oct 2016 13:12:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0Ahp-0001j5-HN for qemu-devel@nongnu.org; Fri, 28 Oct 2016 13:12:39 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:34667) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c0Ahp-0001is-9F; Fri, 28 Oct 2016 13:12:37 -0400 Received: by mail-pf0-x244.google.com with SMTP id u84so1754704pfj.1; Fri, 28 Oct 2016 10:12:37 -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=dpui64W206Zv1AjbZpmFaNn3uw8dBKi7Dlv6XFUNlV0=; b=fOAB9VK39sdQSwAYaFoVzcYrYlkJ4efGen2UZnHesD+ath36ZM06Y3GhKe8gnt4Bpk gArS/qKKY/78P4ekWbbSCuFftYhmCnsuHcTpxUYFS2TRqBRCh9xc84hUi2tlTygZ974j uCtTsnQr++SwFpBOiiccCBnZMKahFNmdbUI8/WXlZQEKmVebymx/r7ZhzFUmxGCLjR8Y hnXEZ6fzCnqyEeYSseRsz2ti7zIufFAlUOPDR28ppUOpxsyT3YBGKKIQQjaWSt2BXGZ9 Af04L8vJ5wSdwb1ZrFIdu+5SCPrJDOy5iUh+k4y6mx7X4m8r9SM6AkX8oJZDWKGkK3Wk bWDQ== 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=dpui64W206Zv1AjbZpmFaNn3uw8dBKi7Dlv6XFUNlV0=; b=blMZKDglLiVeY9HK+6umKbzEl1qBhhdi0ndPASHWrjlNJTls9XGH91mCLtwFoqKvJh RvjDKxYgWe/qvVUePvDPkicdO/BaguH1pxBtFkPWwkTnFbLq7uD29wd0M851SlmxA2rD s5Xr6zm6a8BtKcumvy4Jk06g+iJgecKmWlnBmEeXsSIUb5G+2AmlSe2Spi/2blYfmJD6 tYDQWqn/0TCm2ieDB3vaeuQoZwYURJ7kM8IykdWy90URh4KjZBfMjmmDrwGPMPClmkEu xJ0xKgigDw8yd0wikoo60HNHWE1JoMl41WXw887pcFcIKAM+zCzM6pOPIxJ1Ju12Ivfy eMuQ== X-Gm-Message-State: ABUngvcY0XAlxNgL1Dvj4auurOM8pSDXrV0p965j+mwWQxHWtxv9vw22lfsTEFLcMxkiaA== X-Received: by 10.98.198.69 with SMTP id m66mr27016944pfg.184.1477674755898; Fri, 28 Oct 2016 10:12:35 -0700 (PDT) Received: from linux.local ([47.247.108.77]) by smtp.gmail.com with ESMTPSA id ah5sm20229078pad.30.2016.10.28.10.12.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Oct 2016 10:12:35 -0700 (PDT) From: Ashijeet Acharya To: kwolf@redhat.com Date: Fri, 28 Oct 2016 22:39:30 +0530 Message-Id: <1477674570-25927-3-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1477674570-25927-1-git-send-email-ashijeetacharya@gmail.com> References: <1477674570-25927-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::244 Subject: [Qemu-devel] [PATCH v5 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 | 74 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 3 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 3592a9d..c0c9b48 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1714,14 +1714,14 @@ # # @host_device, @host_cdrom: Since 2.1 # @gluster: Since 2.7 -# @nbd, @ssh: Since 2.8 +# @nbd, @ssh, @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', 'nbd', 'null-aio', + 'host_device', 'http', 'https', 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'parallels', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'replication', 'ssh', 'tftp', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } @@ -2240,6 +2240,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. @@ -2315,7 +2383,7 @@ # TODO iscsi: Wait for structured options 'luks': 'BlockdevOptionsLUKS', 'nbd': 'BlockdevOptionsNbd', -# TODO nfs: Wait for structured options + 'nfs': 'BlockdevOptionsNfs', 'null-aio': 'BlockdevOptionsNull', 'null-co': 'BlockdevOptionsNull', 'parallels': 'BlockdevOptionsGenericFormat',