From patchwork Mon Oct 24 19:27:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ashijeet Acharya X-Patchwork-Id: 9393133 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 3EAE260231 for ; Mon, 24 Oct 2016 19:31:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3083328F77 for ; Mon, 24 Oct 2016 19:31:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2519828F7C; Mon, 24 Oct 2016 19:31: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 ABD8428F77 for ; Mon, 24 Oct 2016 19:31:46 +0000 (UTC) Received: from localhost ([::1]:49357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bykyH-0006Ww-Fb for patchwork-qemu-devel@patchwork.kernel.org; Mon, 24 Oct 2016 15:31:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bykxj-0006Sk-5l for qemu-devel@nongnu.org; Mon, 24 Oct 2016 15:31:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bykxf-0007a5-9l for qemu-devel@nongnu.org; Mon, 24 Oct 2016 15:31:11 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:33537) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bykxe-0007ZA-Uu; Mon, 24 Oct 2016 15:31:07 -0400 Received: by mail-pf0-x243.google.com with SMTP id i85so17319202pfa.0; Mon, 24 Oct 2016 12:31:06 -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=nSP9EkkXa80kUwCoBpiM6QZj8j3COzBwS+63Eq99wni7682ywEZ1WRDHV3Gq7Xv9K7 jfH9ts4aofG5KZ2bAELULmCgspk23uE8dV7s6g2WpIuRbF1Ohr8hxrDwlhjsLQCrrQvx hJRSWSGPslXXKs/2GmudurBXZQmzT8VtMtB2em22fnS49ArA1G1QOoquAnEPSq1mBMjl HfN8XrIJpBDr8SecoekLn5QkA/jckZMqbQP2HNIWIkW1C4HhvpamNR1oxPFxaLByBymm A8vU5h7GuoG0KyDWkcS0LB4GUWt+6HKaIn7pfPvLkxYziLtYeOHl0Ewp58mn2lw/qi85 L/9g== 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=XCjaUSYMrPJiWk1CSLmGujSvbraK2sTGa2GX7RhNplDm3iVcedrgnr3v3Z4Cv/kHlY NRMaqf+1dh9NuH4S47pEmwtogkgQu3xqN5vynQ10X2oc5QN8UcixjJ3l5PJI72yo3MWx 6G/PDYoMyeEU6rvIitZh5d/pwb3h4HEUP3rv9dW4wq9MIzL0iPYwPoKN0PNXwl4fXsmX hiExlYMdSi/lBk5fTvAbVzhcb0kEMjo3/sBVgf0JKL+9KHrnh1uwaN76/9sKGaOC84gf yZuH6ftSVIaiLpNsI3MQ3XXSk8jQIxvoAfX4LXxRhCLi5vs50NmD79Hn87S84vrTaWA6 3oIg== X-Gm-Message-State: ABUngvf1up9Ve/xTFP7j9DCBknh0Ki8r6Lojyqe2ybIdJ2GJLo0r5jc9X5gU/2ASTzdPiA== X-Received: by 10.99.102.69 with SMTP id a66mr25930623pgc.71.1477337465250; Mon, 24 Oct 2016 12:31:05 -0700 (PDT) Received: from linux.local ([47.247.27.170]) by smtp.gmail.com with ESMTPSA id c75sm27273615pfb.23.2016.10.24.12.31.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Oct 2016 12:31:04 -0700 (PDT) From: Ashijeet Acharya To: pl@kamp.de Date: Tue, 25 Oct 2016 00:57:54 +0530 Message-Id: <1477337274-7939-3-git-send-email-ashijeetacharya@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1477337274-7939-1-git-send-email-ashijeetacharya@gmail.com> References: <1477337274-7939-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 v2 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',