Received: from eggs.gnu.org ([2001:4830:134:3::10]:38912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9ndO-0005Vx-EY for qemu-devel@nongnu.org; Tue, 09 Oct 2018 04:44:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9ndJ-0000aZ-KD for qemu-devel@nongnu.org; Tue, 09 Oct 2018 04:44:54 -0400 From: Alberto Garcia In-Reply-To: <1b2e5d06-7b80-43d9-7b66-9b69b67445a5@redhat.com> References: <204d1911-765b-bd4b-27b8-3f1a35a6b9d6@redhat.com> <1b2e5d06-7b80-43d9-7b66-9b69b67445a5@redhat.com> Date: Tue, 09 Oct 2018 10:44:44 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 14/14] block: Stop passing flags to bdrv_reopen_queue_child() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf On Mon 08 Oct 2018 08:46:57 PM CEST, Max Reitz wrote: > On 08.10.18 20:13, Alberto Garcia wrote: >> On Mon 08 Oct 2018 04:48:50 AM CEST, Max Reitz wrote: >> >>>> + /* Old values are used for options that aren't set yet */ >>>> + old_options = qdict_clone_shallow(bs->options); >>>> + bdrv_join_options(bs, options, old_options); >>>> + qobject_unref(old_options); >>>> + >>>> + /* We have the final set of options so let's update the flags */ >>>> + { >>>> + Error *local_err = NULL; >>>> + QemuOpts *opts; >>>> + QDict *options_copy = qdict_clone_shallow(options); >>> >>> I-I'm not sure this conforms to our coding style. >>> >>> While I applaud your effort to keep the patch size small, I know for >>> sure I don't want to read code like this. (Unless it's necessary >>> because of some variables' lifetimes.) >> >> I actually think it makes the code more readable if there are variables >> with a very limited scope (like in this case). But I can also rewrite it >> using a more traditional style. > > I think it should be a function call then. Nah, I don't think this deserves its own function. I'd rather keep everything in the same function. I'll send an updated patch. Berto