Gerd Hoffmann <kra...@redhat.com> writes:

> On 05/24/10 14:32, Paul Brook wrote:
>>> +int is_ioport_assigned(pio_addr_t addr)
>>
>> Shouldn't we move this into register_ioport_{read,write}, and have that fail
>> if the port has already been assigned?
>
> It already checks and fails with hw_error().  Problem with that is
> that this kills qemu in case you try to pci hot-plug a vga card.  So
> I've added a way to check before-hand, so we can fail gracefully in
> the few places where we need it (see second patch of the series).

If we needed in more than a few places, then a solution like the one we
adopted for qdev_init() could make sense: have register_ioport_FOO()
return an error, convert all users that don't want to check it to
register_ioport_FOO_nofail(), which hw_error()s out.

Reply via email to