qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Claudio Fontana <cfontana@suse.de>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	qemu-devel@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	dinechin@redhat.com
Subject: Re: [PATCH] accel: print an error message and exit if plugin not loaded
Date: Tue, 6 Sep 2022 14:14:39 +0200	[thread overview]
Message-ID: <90ec64fb-24fa-aee9-da77-32fc56d3e51e@suse.de> (raw)
In-Reply-To: <aef3408d-6b48-424b-e539-6230ee38b90e@suse.de>

On 9/6/22 13:59, Claudio Fontana wrote:
> On 9/6/22 11:53, Gerd Hoffmann wrote:
>>> In any case, the only thing that "mayfail" seems to control, is in module_load_file, and is a single printf:
>>>
>>>     g_module = g_module_open(fname, flags);
>>>     if (!g_module) {
>>>         if (!mayfail) {
>>>             fprintf(stderr, "Failed to open module: %s\n",
>>>                     g_module_error());
>>>         }
>>>         ret = -EINVAL;
>>>         goto out;
>>>     }
>>>
>>>
>>> Weird.. Is someone building proprietary modules on top of QEMU?
>>
>> Nope.
>>
>> But modules have dependencies to stuff like pci bus, usb bus, vga which
>> might not be satisfied by some system emulators, and trying to load
>> those modules will fail then because of unresolved symbols.  If you drop
>> that 'make check' will log a pile of errors ...
>>
>> Dropping mayfail and return an 'Error' instead makes sense, then it is
>> up to the caller to report or not report the failure.  When calling down
>> from module_load_qom_all() you might want ignore errors for the reasons
>> outlined above, in most other caes it probably makes sense to report
>> them.
>>
>> take care,
>>   Gerd
>>
>>
> 
> Ah I noticed only now... I just sent a series, the module_load_qom_all() then is maybe something to discuss further.
> 
> Thanks,
> 
> Claudio
> 

I noticed however that module_load_qom_all() does _not_ pass true for mayfail.

You changed this behavior in:

commit 9f4a0f0978cde9d8e27453b3f2d3679b53623c47
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Thu Jun 24 12:38:17 2021 +0200

    modules: use modinfo for qom load
    
    Use module database to figure which module implements a given QOM type.
    Drop hard-coded object list.
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
    Reviewed-by: Jose R. Ziviani <jziviani@suse.de>
    Message-Id: <20210624103836.2382472-16-kraxel@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>


and from the patch I understand that this made the mayfail argument completely unnecessary, is that correct?

Thanks,

Claudio



  reply	other threads:[~2022-09-06 13:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05 10:13 [PATCH] accel: print an error message and exit if plugin not loaded Claudio Fontana
2022-09-05 12:06 ` Richard Henderson
2022-09-05 14:36   ` Claudio Fontana
2022-09-05 15:43     ` Claudio Fontana
2022-09-05 16:07       ` Richard Henderson
2022-09-06  9:53       ` Gerd Hoffmann
2022-09-06 11:59         ` Claudio Fontana
2022-09-06 12:14           ` Claudio Fontana [this message]
2022-09-07  7:46             ` Gerd Hoffmann

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=90ec64fb-24fa-aee9-da77-32fc56d3e51e@suse.de \
    --to=cfontana@suse.de \
    --cc=berrange@redhat.com \
    --cc=dinechin@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@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).