qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Claudio Fontana <cfontana@suse.de>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: pbonzini@redhat.com, "Jose R. Ziviani" <jziviani@suse.de>,
	richard.henderson@linaro.org,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH v2 1/1] modules: Improve error message when module is not found
Date: Fri, 23 Jul 2021 14:20:11 +0200	[thread overview]
Message-ID: <6a3940a4-ca70-343b-5724-0f8f59d6fde4@suse.de> (raw)
In-Reply-To: <4b5c010f-1365-e746-c269-9b9e48771f7b@suse.de>

On 7/23/21 1:20 PM, Claudio Fontana wrote:
> On 7/23/21 11:52 AM, Gerd Hoffmann wrote:
>>>> -    g_assert(ops != NULL);
>>>> +    if (ops == NULL) {
>>>> +        exit(1);
>>>> +    }
>>>> +
>>>
>>>
>>> Ah, again, why?
>>> This change looks wrong to me, 
>>>
>>> the ops code should be present when ops interfaces are initialized:
>>> it should be a code level assertion, as it has to do with the proper order of initializations in QEMU,
>>>
>>> why would we want to do anything else but to assert here?
>>>
>>> Am I blind to something obvious?
>>
>> Building tcg accel ops modular moves that from coding error to possible
>> user error (user wants use tcg but has qemu-accel-tcg-$arch.rpm not
>> installed).
> 
> Sorry but without more background I don't buy it.
> 
> If ops is null at the time accel_init_interfaces is called,
> it means that we are trying to initialize the board (for softmmu)
> with an accelerator already selected, and without an accelerator actually available.
> 
> The problem has happened already a long time before we get here.
> 
> When we check for viable accelerators, in configure_accelerators,
> we should check that the code is actually there, before choosing it as a viable accelerator.
> 
> If we march on and start initializing the machine with an accelerator that is not available,
> of course things will start failing left and right.
> 
> If things like:
> 
> bool have_tcg = accel_find("tcg");
> 
> return true when the code is actually not there, there seems to be a larger issue to solve.
> 
> I think we need to think more broadly about this.

Overall, building the whole code base to be modular,
and then _not_ including unwanted modules in the base distro package,

is the whole point of going through this at all.

QEMU should gracefully figure out that indeed, the module is not there -> TCG is not there.

So we need more work to make this actually work right.

> Thanks,
> 
> Claudio
> 
> 
>>
>> The second part of the patch makes qemu print a message on the failed
>> module load, so the user would have a chance to figure where the assert
>> comes from, but replacing the assert with a more friendly message still
>> makes sense to me.
>>
>> take care,
>>   Gerd
>>
> 
> 



  reply	other threads:[~2021-07-23 12:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 22:09 [PATCH v2 0/1] Improve module accelerator error message Jose R. Ziviani
2021-07-22 22:09 ` [PATCH v2 1/1] modules: Improve error message when module is not found Jose R. Ziviani
2021-07-23  6:25   ` Gerd Hoffmann
2021-07-23  8:04     ` Claudio Fontana
2021-07-23  8:28   ` Markus Armbruster
2021-07-23  8:32     ` Claudio Fontana
2021-07-23  9:41   ` Claudio Fontana
2021-07-23  9:52     ` Gerd Hoffmann
2021-07-23 11:20       ` Claudio Fontana
2021-07-23 12:20         ` Claudio Fontana [this message]
2021-07-23 12:48           ` Gerd Hoffmann
2021-07-29  9:14             ` modular tcg (was: Re: [PATCH v2 1/1] modules: Improve error message when module is not) found Gerd Hoffmann
2021-07-29  9:40               ` modular tcg Claudio Fontana
2021-07-29 10:26                 ` Gerd Hoffmann
2021-07-29 10:42                   ` Claudio Fontana
2021-07-29  9:42               ` Claudio Fontana
2021-07-29 10:29                 ` Gerd Hoffmann
2021-07-29 10:44                   ` Claudio Fontana
2021-07-29 11:34                     ` Philippe Mathieu-Daudé
2021-07-29 11:39                       ` Claudio Fontana
2021-07-29 14:22                       ` Claudio Fontana
2021-07-29 14:59                         ` Philippe Mathieu-Daudé
2021-07-29 16:35                           ` Claudio Fontana
2021-07-29 16:40               ` modular tcg (was: Re: [PATCH v2 1/1] modules: Improve error message when module is not) found Paolo Bonzini
2021-07-30  9:05                 ` modular tcg Gerd Hoffmann
2021-07-30 10:02                   ` Claudio Fontana
2022-09-02  9:50               ` modular tcg (was: Re: [PATCH v2 1/1] modules: Improve error message when module is not) found Claudio Fontana
2021-07-23 13:50     ` [PATCH v2 1/1] modules: Improve error message when module is not found Jose R. Ziviani
2021-07-23 14:02       ` Claudio Fontana
2021-07-23 14:14         ` Philippe Mathieu-Daudé
2021-07-23 14:36         ` Jose R. Ziviani
2021-07-23 15:27           ` Claudio Fontana
2021-07-23 15:46             ` Jose R. Ziviani

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=6a3940a4-ca70-343b-5724-0f8f59d6fde4@suse.de \
    --to=cfontana@suse.de \
    --cc=f4bug@amsat.org \
    --cc=jziviani@suse.de \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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).