From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bta5k-0000XU-C1 for qemu-devel@nongnu.org; Mon, 10 Oct 2016 08:54:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bta5f-0007IK-7b for qemu-devel@nongnu.org; Mon, 10 Oct 2016 08:54:03 -0400 Date: Mon, 10 Oct 2016 14:53:50 +0200 From: Kevin Wolf Message-ID: <20161010125350.GH6775@noname.redhat.com> References: <1475923446-29428-1-git-send-email-ashijeetacharya@gmail.com> <20161010091552.GC6775@noname.redhat.com> <20161010113115.GF6775@noname.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] qapi: allow blockdev-add for ssh List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ashijeet Acharya Cc: Eric Blake , armbru@redhat.com, QEMU Developers , "Richard W.M. Jones" , qemu-block@nongnu.org Am 10.10.2016 um 13:54 hat Ashijeet Acharya geschrieben: > On Mon, Oct 10, 2016 at 5:01 PM, Kevin Wolf wrote: > > Your .bdrv_open() callback in ssh gets these options as keys in > > QDict *options, using the dot syntax. options might look like this > > (using "key" = "value" for the example): > > > > "server.host" = "localhost" > > "server.port" = "1234" > > "server.ipv4" = "on" > > "server.ipv6" = "on" > > "path" = "/tmp/test.img" > > "user" = "test" > > > > You can manually parse the "server.*" fields with > > qdict_extract_subqdict() and QemuOpts and then construct an > > InetSocketAddress object in C similar to what NBD does currently. > > > > The other option, and maybe a bit nicer, would be to use a visitor to > > directly go from the (sub-)QDict to InetSocketAddress. > > If I am not wrong, this is how Max did it here to unflatten things: > https://lists.gnu.org/archive/html/qemu-devel/2016-02/msg06709.html > > But they don't seem to have been merged yet. I will rebase on top of > his work though. The current version of his series is v4 (from end of September), which has in turn rebased on top of Dan's "QAPI/QOM work for non-scalar object properties" series, which adds a qdict_crumple() function. This is a more complete function to "unflatten" the dict again. So maybe you want to rebase on top of Dan's series instead of Max's, and just refer to Max's series to see how he's integrating things in the block driver. Kevin