From patchwork Mon Oct 31 15:05:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 689420 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 3t6zRz1BWtz9s5g for ; Tue, 1 Nov 2016 02:53:51 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=JYin++LY; dkim-atps=neutral Received: from localhost ([::1]:36543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1EuD-00020h-1h for incoming@patchwork.ozlabs.org; Mon, 31 Oct 2016 11:53:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1ECo-0001t0-AU for qemu-devel@nongnu.org; Mon, 31 Oct 2016 11:08:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1ECk-00052u-AQ for qemu-devel@nongnu.org; Mon, 31 Oct 2016 11:08:58 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:33854) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c1ECk-00051S-5e; Mon, 31 Oct 2016 11:08:54 -0400 Received: by mail-pf0-x243.google.com with SMTP id y68so3116703pfb.1; Mon, 31 Oct 2016 08:08: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=s6LAvDXXOyWdc9aDoxBq+WXze92sx3zYV5RvxVOTVwI=; b=JYin++LYepSMiKLn2KLzr7+u3tsGRJVl7zrEok7HedayZf9B0l5KwGaD1GxwqXYLOf hxZRM9ZLtVwaE406uhvQki1aJt5T4S5KlK4KPwY6Fmq7nnMNA5u1iggcbnITPvYI5GWT vh7rPhSlLuPqfGxvHotcYF/lVntH4VkHPg3YjXOXrCeNSLJaRBZThfuWDvQEr1L5zr05 aiL45igRuJisjhggpXJWUsaf5y6hYp66p4caANyIm6UReEiSV6Iz2L5d9zeyzEvhro/0 MGO6Ozx3qs9TUoqOt6G5X46ZCce8dz9+Zr99qfDmMIfaUAwpeANMa8aSCsfYNJuk7GBo sEyQ== 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=s6LAvDXXOyWdc9aDoxBq+WXze92sx3zYV5RvxVOTVwI=; b=SFSOFtjCDHxzy7SL9mMGQomDgKwqbjRja8oGXHfgAkAZ4YkdcZ+nz8SF4m60caZVBT SIEd5USj6PCMATusxE/AbzC4KsTAkiImynmeKmSF5gbTugCXiKx/uVfE92SXHXL/pUgC Ga8hS1mkJ0uma+4L33RSm8SX2EnQ4iVzYDnGvKQh70IqAPeMUKNfcoDQudGFjCizwyzM /kwLZ3uZ75yFDWsYUyPfYlJOf2WV3QSPKEwtweLe5NDrxzYgEhCAi4KECC5ZTiqfu5vI fYDL+r0cKYB8CnPpq3Fcc+YK93PXiLt5Ni3QvsLqb/dShLOkvxYX9opXhFdtT38AtpVK bWUA== X-Gm-Message-State: ABUngveC2CfN2Ozlq9TUtODUqCgs4YD0Zou8hcNTmcLlwpnDqg1rPLTrxhyPa+gIpxZczw== X-Received: by 10.98.13.75 with SMTP id v72mr49757858pfi.42.1477926533315; Mon, 31 Oct 2016 08:08:53 -0700 (PDT) Received: from linux.local ([106.208.120.62]) by smtp.gmail.com with ESMTPSA id sh9sm109036pac.41.2016.10.31.08.08.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Oct 2016 08:08:52 -0700 (PDT) From: Ashijeet Acharya To: kwolf@redhat.com Date: Mon, 31 Oct 2016 20:35:50 +0530 Message-Id: <1477926350-15869-3-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1477926350-15869-1-git-send-email-ashijeetacharya@gmail.com> References: <1477926350-15869-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 v6 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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, @nfs, @ssh: 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',