From: Auger Eric <eric.auger@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: peter.maydell@linaro.org, mst@redhat.com, qemu-devel@nongnu.org,
alex.williamson@redhat.com, qemu-arm@nongnu.org,
pbonzini@redhat.com, eric.auger.pro@gmail.com
Subject: Re: [Qemu-devel] [PATCH v1 1/6] memory: allow memory_region_register_iommu_notifier() to fail
Date: Thu, 19 Sep 2019 13:45:33 +0200 [thread overview]
Message-ID: <b7422cc9-f5d0-43bc-0f2e-2472f0243460@redhat.com> (raw)
In-Reply-To: <20190916032326.GC14232@xz-x1>
Hi Peter,
On 9/16/19 5:23 AM, Peter Xu wrote:
> On Fri, Sep 13, 2019 at 10:36:10AM +0200, Eric Auger wrote:
>> Currently, when a notifier is attempted to be registered and its
>> flags are not supported (especially the MAP one) by the IOMMU MR,
>> we generally abruptly exit in the IOMMU code. The failure could be
>> handled more nicely in the caller and especially in the VFIO code.
>>
>> So let's allow memory_region_register_iommu_notifier() to fail as
>> well as notify_flag_changed() callback.
>>
>> All sites implementing the callback are updated. This patch does
>> not yet remove the exit(1) in the intel_iommu and amd_iommu code.
>
> The idea looks sane to me, though how about using "Error **" instead
> of returning int (or, both)? Just like the majority of rest of QEMU.
None of the memory_region_register_iommu_notifier callsites would really
use the Error object and pass it up. I am a bit reluctant to add it if
not really used. There are still plenty of functions in the memory API
that do not use any Error handle. Anyway I will follow recommendations
if there is a consensus.
Thanks
Eric
>
> Regards,
>
next prev parent reply other threads:[~2019-09-19 11:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-13 8:36 [Qemu-devel] [PATCH v1 0/6] Allow memory_region_register_iommu_notifier() to fail Eric Auger
2019-09-13 8:36 ` [Qemu-devel] [PATCH v1 1/6] memory: allow " Eric Auger
2019-09-16 3:23 ` Peter Xu
2019-09-19 11:45 ` Auger Eric [this message]
2019-09-13 8:36 ` [Qemu-devel] [PATCH v1 2/6] vfio/common: Handle memory_region_register_iommu_notifier() failure Eric Auger
2019-09-13 8:36 ` [Qemu-devel] [PATCH v1 3/6] exec: assert on " Eric Auger
2019-09-13 9:20 ` Andrew Jones
2019-09-13 8:36 ` [Qemu-devel] [PATCH v1 4/6] vhost: " Eric Auger
2019-09-13 8:36 ` [Qemu-devel] [PATCH v1 5/6] intel_iommu: Let vtd_iommu_notify_flag_changed() fail Eric Auger
2019-09-16 3:33 ` Peter Xu
2019-09-13 8:36 ` [Qemu-devel] [PATCH v1 6/6] amd_iommu: Let amdvi_iommu_notify_flag_changed() fail Eric Auger
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=b7422cc9-f5d0-43bc-0f2e-2472f0243460@redhat.com \
--to=eric.auger@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=eric.auger.pro@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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).