From patchwork Wed Oct 19 12:38:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9383949 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 C61B9600CA for ; Wed, 19 Oct 2016 12:41:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7FF9299FD for ; Wed, 19 Oct 2016 12:41:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACE17299FF; Wed, 19 Oct 2016 12:41:58 +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=-3.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, 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 55C6A299FD for ; Wed, 19 Oct 2016 12:41:58 +0000 (UTC) Received: from localhost ([::1]:47792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwqBx-0006Op-J2 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 19 Oct 2016 08:41:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwqBM-0006M6-JA for qemu-devel@nongnu.org; Wed, 19 Oct 2016 08:41:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwqBH-00025C-IX for qemu-devel@nongnu.org; Wed, 19 Oct 2016 08:41:20 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:34941) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwqBH-00023i-D1; Wed, 19 Oct 2016 08:41:15 -0400 Received: by mail-pf0-x244.google.com with SMTP id s8so2411292pfj.2; Wed, 19 Oct 2016 05:41:15 -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=31R/sqcmmkRl0ctNdJlhCXBKC3m87idPBX4w5NNIOQQ=; b=sTaFB7ccplMiSp9smnXjeiCSfHm7bx82mLo/+lO6s006GGsYj2z3JfOm5OaugBGEVe Ah+eW13FZDd0FCm9EKO/mMdZdqATpx62EtwEe5GQY2VzNVDylhSzk1i7q037GHAh3+kL s1pdWTGcGZ4WdUJwpSRB99DOAOMr1orRb+pucdMBZGTIPvyATxzkE8moQFpl4YN2J38T swu8XLsHYXl8KOxKZigC5V+HwUzdHQtEXeY+KkFY9LhEf2SxHVhJ3LOh2ej2JtbE+3lD KdSftyXZFoCJeXf9oGlc0UFJv32q8PlDd3koCTf/rjUZ5XS9f3FzbQn6KdWcGcVsHGAg EiWA== 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=31R/sqcmmkRl0ctNdJlhCXBKC3m87idPBX4w5NNIOQQ=; b=d8DM0snTsYsoUhjM47u+7Zm2lv+2cs8H+d9pF5AkQyQeyKN1Hplmo5V2N0+fLpLh+V LXjMlPSr8slC7mjqJo/5sI30I+QgRRy9y69HBgYBy0InMfXaVN7AebJov/JHmGRS2hda YxtGvxX6c9HwFoUgXJKSiSeMRgla1xcQLDRJhO31Q0cW4+U5J/Hi3vMYIZ7PbXhmWB5l 7qEpDWtOSDbVusst00gfB1WMg+TRoIMqxNpKHsDYhzUNUCU0V/UNYVVVdym+argBLzLq QFqhM7PawpTo+Xfi2vET2dSQuKk74lnoWNEKsceNSqFIBtl+goa6RNH7dRAVL2HyaI+b xACg== X-Gm-Message-State: AA6/9RloZhvXErzz2LKg23wVlD43L3fwdV0zGpRIf8gAQXrEWeQ7S4xObaPnSyrb4FsOcQ== X-Received: by 10.99.55.21 with SMTP id e21mr8999422pga.60.1476880874498; Wed, 19 Oct 2016 05:41:14 -0700 (PDT) Received: from linux.local ([27.251.197.196]) by smtp.gmail.com with ESMTPSA id xv9sm63943209pab.36.2016.10.19.05.41.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Oct 2016 05:41:14 -0700 (PDT) From: Ashijeet Acharya To: pl@kamp.de Date: Wed, 19 Oct 2016 18:08:31 +0530 Message-Id: <1476880711-854-3-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1476880711-854-1-git-send-email-ashijeetacharya@gmail.com> References: <1476880711-854-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 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: kwolf@redhat.com, qemu-block@nongnu.org, jcody@redhat.com, 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 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 9d797b8..3ab028d 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1714,9 +1714,9 @@ { '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 +2212,54 @@ '*top-id': 'str' } } ## +# @NFSServer +# +# Captures the address of the socket +# +# @type: transport type used for NFS (only TCP supported) +# +# @host: host part of the address +# +# Since 2.8 +## +{ 'struct': 'NFSServer', + 'data': { 'type': 'str', + 'host': 'str' } } + +## +# @BlockdevOptionsNfs +# +# Driver specific block device option for NFS +# +# @server: host address +# +# @path: path of the image on the host +# +# @uid: #optional UID value to use when talking to the server +# +# @gid: #optional GID value to use when talking to the server +# +# @tcp-syncnt: #optional number of SYNs during the session establishment +# +# @readahead: #optional set the readahead size in bytes +# +# @pagecache: #optional set the pagecache size in bytes +# +# @debug: #optional set the NFS debug level (max 2) +# +# Since 2.8 +## +{ 'struct': 'BlockdevOptionsNfs', + 'data': { 'server': 'NFSServer', + 'path': 'str', + '*uid': 'int', + '*gid': 'int', + '*tcp-syncnt': 'int', + '*readahead': 'int', + '*pagecache': 'int', + '*debug': 'int' } } + +## # @BlockdevOptionsCurl # # Driver specific block device options for the curl backend. @@ -2269,7 +2317,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',