[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 14/14] block: Stop passing flags to bdrv_reopen_
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH 14/14] block: Stop passing flags to bdrv_reopen_queue_child() |
Date: |
Mon, 8 Oct 2018 20:46:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
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.
Max
signature.asc
Description: OpenPGP digital signature