From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Suyr5-0002fA-5z for qemu-devel@nongnu.org; Sat, 28 Jul 2012 00:42:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Suyr4-00012U-0a for qemu-devel@nongnu.org; Sat, 28 Jul 2012 00:42:19 -0400 Received: from e28smtp05.in.ibm.com ([122.248.162.5]:59751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Suyr3-0000vg-DD for qemu-devel@nongnu.org; Sat, 28 Jul 2012 00:42:17 -0400 Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 28 Jul 2012 10:12:09 +0530 Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6S4g5ko24379550 for ; Sat, 28 Jul 2012 10:12:06 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6S4g56F030341 for ; Sat, 28 Jul 2012 14:42:05 +1000 Date: Sat, 28 Jul 2012 10:13:25 +0530 From: Bharata B Rao Message-ID: <20120728044325.GA7332@in.ibm.com> References: <20120725055806.GB1392@in.ibm.com> <20120725060008.GD1392@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v3 2/2] block: Support GlusterFS as a QEMU block backend Reply-To: bharata@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Amar Tumballi , Anand Avati , qemu-devel@nongnu.org, Vijay Bellur On Fri, Jul 27, 2012 at 06:44:04PM +0000, Blue Swirl wrote: > > +struct GlusterOpts { > > static Sure. > > > + bool optional; > > + char defval[10]; > > const char *defval? Sure I could. > > > + char *value; > > +} GlusterOpts[] = { > > + {false, "", NULL }, > > + {false, "", NULL }, > > + {true, "0", NULL }, > > + {true, "socket", NULL }, > > + {false, "", NULL }, > > + {false, "", NULL }, > > +}; > > + > > + if (i == GOPT_LAST-1 && strlen(q)) { > > Spaces around '-'. checkpatch.pl doesn't enforce this, but I can change. > > + > > + port = strtoul(GlusterOpts[GOPT_PORT].value, NULL, 0); > > + if (port < 0) { > > port > 65535 could be bad too. Actually I am just checking if strtoul gave me a valid integer only and depending on gluster to flag an error for invalid port number. But I guess no harm in checking for valid port range here. Is there a #define equivalent for 65535 ? > > > + > > + fd = glfs_creat(glfs, GlusterOpts[GOPT_IMAGE].value, > > + O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, S_IRUSR|S_IWUSR); > > Spaces around '|'. Again, checkpatch.pl doesn't enforce this, but I can change. Thanks for take time to review. Regards, Bharata.