qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, Fam Zheng <fam@euphon.net>,
	"open list:Sheepdog" <sheepdog@lists.wpkg.org>,
	qemu-block@nongnu.org, Jeff Cody <codyprime@gmail.com>,
	Stefan Weil <sw@weilnetz.de>,
	Markus Armbruster <armbru@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Liu Yuan <namei.unix@gmail.com>,
	"Denis V. Lunev" <den@openvz.org>, John Snow <jsnow@redhat.com>
Subject: Re: [PATCH v2 1/3] block: Add blk_new_with_bs() helper
Date: Fri, 24 Apr 2020 16:25:19 +0200	[thread overview]
Message-ID: <39df248e-cc1a-6a16-7ff2-0443d7548bc3@redhat.com> (raw)
In-Reply-To: <9d1d05f0-2e28-7912-b00b-93d2654d8373@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 1082 bytes --]

On 24.04.20 16:18, Eric Blake wrote:
> On 4/24/20 5:02 AM, Max Reitz wrote:
> 
>>> (With the Patchew warning fixed, of course (i.e., we should set ret to
>>> -EPERM or something in qcow.c))
>>
>> Er, well, maybe I should have looked into more places.  The compiler
>> only warns about that single one because it’s the only place where @ret
>> is really uninitialized, but there are many more where we need to set
>> it: crypto.c, parallels.c, qcow.c, qcow2.c (both hunks), qed.c,
>> sheepdog.c, vdi.c, vhdx.c, and vpc.c.
>>
>> (So basically everywhere but vmdk.c, blockdev.c, and blockjob.c.)
> 
> Urgh - so it's even less of a win in terms of reduced lines of code.

True, but I still consider it a win in terms of reduced complexity.
Before, we have two function calls with two variable assignments from
their return values (@blk and @ret).  Afterwards, we’ll have a single
function all with one variable assignment from its return value (@blk),
and one stand-alone variable assignment with a constant value (“ret =
-EPERM” or similar). :)

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-04-24 14:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 22:17 [PATCH v2 0/3] qcow2: Allow resize of images with internal snapshots Eric Blake
2020-04-23 22:17 ` [PATCH v2 1/3] block: Add blk_new_with_bs() helper Eric Blake
2020-04-24  9:53   ` Max Reitz
2020-04-24  9:56     ` Max Reitz
2020-04-24 10:02       ` Max Reitz
2020-04-24 14:18         ` Eric Blake
2020-04-24 14:25           ` Max Reitz [this message]
2020-04-24 12:23   ` Stefan Hajnoczi
2020-04-23 22:17 ` [PATCH v2 2/3] qcow2: Allow resize of images with internal snapshots Eric Blake
2020-04-24 10:40   ` Max Reitz
2020-04-23 22:17 ` [PATCH v2 3/3] qcow2: Tweak comment about bitmaps vs. resize Eric Blake
2020-04-24 10:41   ` Max Reitz
2020-04-23 22:28 ` [PATCH v2 0/3] qcow2: Allow resize of images with internal snapshots no-reply
2020-04-23 22:32 ` no-reply
2020-04-23 22:35 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39df248e-cc1a-6a16-7ff2-0443d7548bc3@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=codyprime@gmail.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=namei.unix@gmail.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sheepdog@lists.wpkg.org \
    --cc=stefanha@redhat.com \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).