From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcK6d-00073I-Ug for qemu-devel@nongnu.org; Tue, 23 Aug 2016 18:23:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcK6Z-0002LA-LQ for qemu-devel@nongnu.org; Tue, 23 Aug 2016 18:23:38 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:34455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcK6Z-0002Kw-HF for qemu-devel@nongnu.org; Tue, 23 Aug 2016 18:23:35 -0400 Received: by mail-it0-f68.google.com with SMTP id e63so189641ith.1 for ; Tue, 23 Aug 2016 15:23:35 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20160823215803.GA24259@stefanha-x1.localdomain> References: <1471149312-28148-1-git-send-email-ashish.mittal@veritas.com> <20160815102046.GC13261@redhat.com> <23ea8348-7ed9-7e45-1079-235614dc90c2@redhat.com> <20160823215803.GA24259@stefanha-x1.localdomain> From: ashish mittal Date: Tue, 23 Aug 2016 15:22:34 -0700 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v3 RFC] block/vxhs: Initial commit to add Veritas HyperScale VxHS block device support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Paolo Bonzini , "Daniel P. Berrange" , qemu-devel@nongnu.org, kwolf@redhat.com, Markus Armbruster , Ashish Mittal , Ketan.Nilangekar@veritas.com, Abhijit.Dey@veritas.com Thanks Stefan, I will look at block/quorum.c. I have sent V4 of the patch with a reworked parsing logic for both JSON and URI. Both of them are quite compact now. URI parsing now follows the suggestion given by Kevin. /================/ However, you should use the proper interfaces to implement this, which is .bdrv_parse_filename(). This is a function that gets a string and converts it into a QDict, which is then passed to .bdrv_open(). So it uses exactly the same code path in .bdrv_open() as if used directly with QAPI. /================/ Additionally, I have fixed all the issues pointed out by you on V1 of the patch. The only change I haven't done is to replace pipes with QEMUBH. I am hoping this will not hold up the patch from being accepted, and I can make this transition later with proper dev and testing. Regards, Ashish On Tue, Aug 23, 2016 at 2:58 PM, Stefan Hajnoczi wrote: > On Sat, Aug 20, 2016 at 11:42:22AM -0700, ashish mittal wrote: >> I'm trying to understand how I can parse a json command line having >> multiple server list (InetSocketAddressList) without the QemuOpts -> >> QDict -> QAPI conversion that I am currently doing. >> >> block/nbd.c has been suggested, but it only parses a single host >> entry, which is pretty straightforward, but not very helpful. >> >> Could somebody please suggest a sample implementation (other than >> gluster.c) that parses a list of server like options in the json >> format? > > Another block driver that takes an array of objects is block/quorum.c. > See quorum_open() and how it picks out "children." objects. > > I haven't read the full discussion in this thread but maybe that's what > you're looking for. > > Stefan