On 31/12/23 11:48, Avihai Horon wrote:
There are several places where failure in setting the device state leads
to a device reset, which is done by setting ERROR as the recover state.
Add a helper function that sets the device state and resets the device
in case of failure. This will make the code cleaner and remove duplicate
comments.
Signed-off-by: Avihai Horon <avih...@nvidia.com>
---
hw/vfio/migration.c | 41 +++++++++++++++++------------------------
1 file changed, 17 insertions(+), 24 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>