qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: thuth@redhat.com, qemu-block@nongnu.org, qemu-trivial@nongnu.org,
	Eric Blake <eblake@redhat.com>,
	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 14:55:16 +0200	[thread overview]
Message-ID: <YVWztO5kIHLlCCZW@redhat.com> (raw)
In-Reply-To: <be93f4d4-6521-a691-fe7a-68b998d5c4df@virtuozzo.com>

Am 30.09.2021 um 14:18 hat Vladimir Sementsov-Ogievskiy geschrieben:
> 9/30/21 12:46, Kevin Wolf wrote:
> > Am 29.09.2021 um 07:30 hat ~farzon geschrieben:
> > > From: Farzon Lotfi <hi@farzon.org>
> > > 
> > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/371
> > > 
> > > Signed-off-by: Farzon Lotfi <hi@farzon.org>
> > 
> > Just picking one example, but it applies to most hunks of the patch:
> > 
> > > diff --git a/block/parallels.c b/block/parallels.c
> > > index 6ebad2a2bb..629d8aae2b 100644
> > > --- a/block/parallels.c
> > > +++ b/block/parallels.c
> > > @@ -916,11 +916,11 @@ static void parallels_close(BlockDriverState *bs)
> > >   }
> > >   static BlockDriver bdrv_parallels = {
> > > -    .format_name	= "parallels",
> > > -    .instance_size	= sizeof(BDRVParallelsState),
> > > -    .bdrv_probe		= parallels_probe,
> > > -    .bdrv_open		= parallels_open,
> > > -    .bdrv_close		= parallels_close,
> > > +    .format_name    = "parallels",
> > > +    .instance_size  = sizeof(BDRVParallelsState),
> > > +    .bdrv_probe     = parallels_probe,
> > > +    .bdrv_open      = parallels_open,
> > > +    .bdrv_close     = parallels_close,
> > >       .bdrv_child_perm          = bdrv_default_perms,
> > >       .bdrv_co_block_status     = parallels_co_block_status,
> > >       .bdrv_has_zero_init       = bdrv_has_zero_init_1,
> > 
> > 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.

Kevin



  reply	other threads:[~2021-09-30 12:57 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 [this message]
2021-09-30 20:27       ` Eric Blake
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=YVWztO5kIHLlCCZW@redhat.com \
    --to=kwolf@redhat.com \
    --cc=eblake@redhat.com \
    --cc=farzon@farzon.org \
    --cc=jsnow@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).