qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: thuth@redhat.com,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org, qemu-trivial@nongnu.org,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	~farzon <farzon@farzon.org>,
	jsnow@redhat.com
Subject: Re: [PATCH qemu v2] QEMU coding style mandates spaces for indentation. This change replaces TABs in block files.
Date: Thu, 30 Sep 2021 15:27:14 -0500	[thread overview]
Message-ID: <20210930202714.y4mbrtcwlk3j665q@redhat.com> (raw)
In-Reply-To: <YVWztO5kIHLlCCZW@redhat.com>

On Thu, Sep 30, 2021 at 02:55:16PM +0200, Kevin Wolf wrote:
> > > When we're changing these lines anyway, let's make sure to have
> > > consistent alignment with the surrounding code. So I would prefer
> > > something like:
> > > 
> > > +    .bdrv_close               = parallels_close,
> > >       .bdrv_child_perm          = bdrv_default_perms,
> > > 
> > > Rather than:
> > > 
> > > +    .bdrv_close     = parallels_close,
> > >       .bdrv_child_perm          = bdrv_default_perms,
> > > 
> > > In most cases, there are already inconsistencies in the BlockDriver
> > > definitions, but let's use the chance to make it a little better.
> > 
> > 
> > Or may be drop alignment around '=' at all, to have
> > 
> >    .bdrv_child_perm = bdrv_default_perms,
> >    .bdrv_co_block_status = parallels_co_block_status,
> >    .bdrv_has_zero_init = bdrv_has_zero_init_1,
> > 
> > ?
> 
> You're right that this would make it easy to keep things consistent, but
> I think it hurts readability a lot, even compared to the current, often
> inconsistent state.

I agree that the alignment adds a bit of readability, but also
understand that it adds a maintenacne burden.  Thus, in code I manage,
I'm fine with either style (no extra spaces, or '=' lined up); and can
live with different styles in different files (which I then will honor
when doing a grunt-work patch that touches all of the block drivers).
But what I don't like is when a single file cannot be consistent with
itself on which of those two styles it is using - a file that uses
aligned '=' really needs to put that '=' far enough to the right that
an added long-named member doesn't cause frequent reindentation of the
rest of the members.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2021-09-30 20:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29  5:30 [PATCH qemu v2] QEMU coding style mandates spaces for indentation. This change replaces TABs in block files ~farzon
2021-09-30  9:46 ` Kevin Wolf
2021-09-30 12:18   ` Vladimir Sementsov-Ogievskiy
2021-09-30 12:55     ` Kevin Wolf
2021-09-30 20:27       ` Eric Blake [this message]
2021-09-30 20:41 ` Eric Blake

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=20210930202714.y4mbrtcwlk3j665q@redhat.com \
    --to=eblake@redhat.com \
    --cc=farzon@farzon.org \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=vsementsov@virtuozzo.com \
    /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).