qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/4] block: refactor commit_run for multiple write types


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v2 2/4] block: refactor commit_run for multiple write types
Date: Fri, 2 Aug 2024 13:22:22 +0300
User-agent: Mozilla Thunderbird

On 14.07.24 00:56, Vincent Vanlaer wrote:
Signed-off-by: Vincent Vanlaer<libvirt-e6954efa@volkihar.be>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>

Honestly, I don't like this (mostly preexisting, but your patch make the problem more 
obvious) code for its "nested success path"

if (ret >= 0) {
  ret = ...
  if (ret >= 0) {

   ...


That's because we have the same complex error handling for all these errors. If refactor 
the commit_run(), I'd move get-block-status together with "if (copy)" block to 
separate function commmit_iteration(), which would have more readable style of error 
reporting, like:

ret = ...
if (ret < 0) {
   return ret;
}

ret = ...
if (ret < 0) {
   return ret;
}

--
Best regards,
Vladimir




reply via email to

[Prev in Thread] Current Thread [Next in Thread]