All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-devel@nongnu.org, "Laurent Vivier" <lvivier@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Markus Armbruster" <armbru@redhat.com>
Subject: Re: [PATCH] qtests: avoid printing comments before g_test_init()
Date: Fri, 24 Mar 2023 18:29:27 +0100	[thread overview]
Message-ID: <87ttyakqh4.fsf@secure.mitica> (raw)
In-Reply-To: <8df76c27-89b5-baee-9738-9b7585ae01e0@redhat.com> (Thomas Huth's message of "Fri, 24 Mar 2023 08:34:13 +0100")

Thomas Huth <thuth@redhat.com> wrote:
> On 23/03/2023 19.31, Juan Quintela wrote:
>> Daniel P. Berrangé <berrange@redhat.com> wrote:
>>> The TAP protocol version line must be the first thing printed on
>>> stdout. The migration test failed that requirement in certain
>>> scenarios:
>>>
>>>    # Skipping test: Userfault not available (builtdtime)
>>>    TAP version 13
>>>    # random seed: R02Sc120c807f11053eb90bfea845ba1e368
>>>    1..32
>>>    # Start of x86_64 tests
>>>    # Start of migration tests
>>>    ....
>>>
>>> The TAP version is printed by g_test_init(), so we need to make
>>> sure that any methods which print are run after that.
>>>
>>> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
>>> ---
>> Reviewed-by: Juan Quintela <quintela@redhat.com>
>> 
>>> -    const bool has_kvm = qtest_has_accel("kvm");
>>> -    const bool has_uffd = ufd_version_check();
>>> -    const char *arch = qtest_get_arch();
>>> +    bool has_kvm;
>>> +    bool has_uffd;
>>> +    const char *arch;
>> Why don't you move also the declarations of the variables?
>> I think that one of the biggest troubles of C is variables that are not
>> initialized.
>> All compilers that we support are C99 or later, so we can do that
>> (and
>> we already do in lot of places.)
>
> I think the coding style has been created before we switched to
> -std=gnu99 for compiling QEMU, so a lot of GCCs were still using C89
> by default?

Yes, that is the actitude.

I got sick when I see new code that still does:

char *foo = (char *)malloc(...);

It is is C89, it has been enough to know that it is not needed.

And yes, that particular one is not used in qemu anymore, but:

void *opaque;

....

Foo *foo = (Foo *)opaque;

Is still introduced in new code, and it is not needed since C89.

>> And yeap, I know that CodingStyle says otherwise, but I think that what
>> is wrong is CodingStyle.
>> https://lists.gnu.org/archive/html/qemu-devel/2023-02/msg03836.html
>
> Please use proper prefixes in the subject when sending patches
> ("docs/devel:" here), otherwise your patches might not get the right
> attention (at least on my side, it was filtered away as a patch that
> was relevant to me) - and also put some recent contributors on CC:

I didn't knew the docs/devel preffix.

About the CC'd, I expected that git-publish be good enough at doing
that, but it appears not.

Anyways, thanks.

Later, Juan.



  reply	other threads:[~2023-03-24 17:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 17:05 [PATCH] qtests: avoid printing comments before g_test_init() Daniel P. Berrangé
2023-03-17 17:08 ` Peter Maydell
2023-03-17 17:28 ` Alex Bennée
2023-03-20  8:01 ` Thomas Huth
2023-03-23 18:31 ` Juan Quintela
2023-03-24  7:34   ` Thomas Huth
2023-03-24 17:29     ` Juan Quintela [this message]
2023-03-24 17:39       ` Alex Bennée

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=87ttyakqh4.fsf@secure.mitica \
    --to=quintela@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.