[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-4.0 v9 09/16] qemu_thread: supplement error
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH for-4.0 v9 09/16] qemu_thread: supplement error handling for pci_edu_realize |
Date: |
Mon, 14 Jan 2019 13:36:13 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Fei Li <address@hidden> writes:
> Just to make sure about how to do the cleanup. I notice that in
> device_set_realized(),
> the current code does not call "dc->unrealize(dev, NULL);" when dc->realize()
> fails.
>
> if (dc->realize) {
> dc->realize(dev, &local_err);
> }
>
> if (local_err != NULL) {
> goto fail;
> }
>
> Is this on purpose? (Maybe due to some devices' realize() do their own cleanup
> when fails? Sorry for the unsure, it is such a common function that I did not
> check all. :( ) Or else, I prefer to do the cleanup in a unified manner, e.g.
> call "dc->unrealize(dev, NULL);" which is the pci_qdev_unrealize() for pci
> devices.
Yes, this is on purpose.
When a realize() method fails, it must revert everything it has done so
far. Results in sane "either succeed completely, or fail and do
nothing" semantics.
Re: [Qemu-devel] [PATCH for-4.0 v9 09/16] qemu_thread: supplement error handling for pci_edu_realize, Fei Li, 2019/01/13
- Re: [Qemu-devel] [PATCH for-4.0 v9 09/16] qemu_thread: supplement error handling for pci_edu_realize,
Markus Armbruster <=