From patchwork Thu Oct 27 10:43:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9399171 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 CE95D60231 for ; Thu, 27 Oct 2016 10:50:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C58902A041 for ; Thu, 27 Oct 2016 10:50:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA0E62A0BC; Thu, 27 Oct 2016 10:50:54 +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 55F422A041 for ; Thu, 27 Oct 2016 10:50:54 +0000 (UTC) Received: from localhost ([::1]:40199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bziGr-00043y-E9 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 27 Oct 2016 06:50:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bziD1-0001nY-Q4 for qemu-devel@nongnu.org; Thu, 27 Oct 2016 06:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bziD0-0003Mg-RA for qemu-devel@nongnu.org; Thu, 27 Oct 2016 06:46:55 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:35981) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bziD0-0003MT-LO; Thu, 27 Oct 2016 06:46:54 -0400 Received: by mail-pf0-x241.google.com with SMTP id n85so2327951pfi.3; Thu, 27 Oct 2016 03:46:54 -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=cnRzdPrvYf8y+lIEGKwcZ7RrZRAwUG00pI4TILdGKzY=; b=gB8EI64o/eyuD7DAfhQJzdn8aDA8rhL7i3Ab2EkdG1LvEG4Z30OcP/Fp+eLYYc5yYg UsjH0dOODwou5Ok1eFwnj1Wa10oYzAfpe9fPaLLxV9uVgrQ40Qi+Syf6IKHjQ4/moYc6 xuoQ3wIUG6vqquiV4mT8J+mZ0QFh/bogFm8ok9vDiN1oqtEWi1RImOTF1aodI/o2tvIp yD7n9eMrk19tiewrItJKiBSYTC3Sy1J5q/30ItGHqc+aAVfbJWcW7xTOQoOw/+yfNUES +rtNJH9xH4cOaKA7Ogpj/1oI/VWNPfv+cwDI1O3eCmo8T+Kk28PaVeYPiPGFdyNB8+ve voCA== 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=cnRzdPrvYf8y+lIEGKwcZ7RrZRAwUG00pI4TILdGKzY=; b=adJXgTOWJ7dIPpEWHlHz1t3lrsrbvBHr/32wfQW68+pKyL4tkAbDBxi9iU+YKkyE6F a+2rThxKvGsO3ZSbIjVisXxTEGorPRNZRdpUp7xnazd2QAJ6tllOc/t8NWd63zKXbbSb X9GnY1z/5bJZMCWc0vEDVzK+xLJV9QIL5GFWvaIULiV3ssSmSivQbZX3Nvy3Zz82c+1T IWVW5OZ+tiFO1ZCu1WgR9i7meiFAcHLqAqcHJum0W1AaEIHd7YmRimedLMu784ej1Ny7 TwkDn7t27M/PlKrIpRflzkIKuCXCLUJAyFKu+HEutMaBVvdp7wl9Yoar1tAguxTCTW2n IdWA== X-Gm-Message-State: ABUngvePdof/6EPcZyEhiBfwK5M60tJDR2NfwB2XnoykCW0i+riMED2tW1veMloFFLkRjw== X-Received: by 10.98.130.11 with SMTP id w11mr13508259pfd.101.1477565213693; Thu, 27 Oct 2016 03:46:53 -0700 (PDT) Received: from linux.local ([47.247.49.45]) by smtp.gmail.com with ESMTPSA id h8sm10808715pab.9.2016.10.27.03.46.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Oct 2016 03:46:53 -0700 (PDT) From: Ashijeet Acharya To: kwolf@redhat.com Date: Thu, 27 Oct 2016 16:13:42 +0530 Message-Id: <1477565022-11377-3-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1477565022-11377-1-git-send-email-ashijeetacharya@gmail.com> References: <1477565022-11377-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::241 Subject: [Qemu-devel] [PATCH v3 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..75e28aa 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: host address for NFS server +# +# Since 2.8 +## +{ 'enum': 'NFSTransport', + 'data': [ 'inet' ] } + +## +# @NFSServer +# +# Captures the address of the socket +# +# @type: transport type used for NFS (only TCP supported) +# +# @inet: 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',