From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WELV0-0001lE-AM for qemu-devel@nongnu.org; Fri, 14 Feb 2014 11:20:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WELUu-00079s-AK for qemu-devel@nongnu.org; Fri, 14 Feb 2014 11:20:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WELUu-00079M-14 for qemu-devel@nongnu.org; Fri, 14 Feb 2014 11:20:16 -0500 Date: Fri, 14 Feb 2014 11:20:04 -0500 From: Jeff Cody Message-ID: <20140214162004.GB17514@localhost.localdomain> References: <925f4c0a62291c070991d1b3e75a770de986a686.1391541706.git.jcody@redhat.com> <20140214142128.GF17391@stefanha-thinkpad.redhat.com> <20140214144146.GF10167@localhost.localdomain> <20140214153802.GA23572@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140214153802.GA23572@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] block: gluster - code movements, state storage changes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, Stefan Hajnoczi , qemu-devel@nongnu.org, bharata@linux.vnet.ibm.com On Fri, Feb 14, 2014 at 04:38:03PM +0100, Stefan Hajnoczi wrote: > On Fri, Feb 14, 2014 at 09:41:46AM -0500, Jeff Cody wrote: > > On Fri, Feb 14, 2014 at 03:21:28PM +0100, Stefan Hajnoczi wrote: > > > On Tue, Feb 04, 2014 at 02:26:58PM -0500, Jeff Cody wrote: > > > > @@ -291,23 +311,17 @@ static int qemu_gluster_open(BlockDriverState *bs, QDict *options, > > > > > > > > filename = qemu_opt_get(opts, "filename"); > > > > > > > > + s->filename = g_strdup(filename); > > > > > > It's not obvious to me that copying the filename is necessary. > > > block/raw-posix.c does this: > > > > > > raw_s->fd = qemu_open(state->bs->filename, raw_s->open_flags); > > > > > > Why didn't you use bs->filename? > > > > > > > Back when the raw-posix reopen was implemented, the .bdrv_file_open > > used the char * filename instead of options parameters. Now that the > > filename is explicitly parsed via the options, I thought it made > > logical sense to cache the filename into the protocol state variable, > > for later use by reopen. > > > > That way if the bs->filename was changed in some manner, the protocol > > would have the variable as originally intended to be passed to the > > .bdrv_file_open() method. > > > > In reality, I should be able to just use bs->filename instead, as it > > does not get modified; this just seemed to make a bit more sense. > > I thought about driver-specific options that are not part of 'filename', > too. IMO it's simpler to use bs->filename until we actually use > driver-specific options, and then switch over to using bs->options > instead of copying. > OK, I'll make that change for v2 as well.