[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] isa-fdc: assert replaced by proper error exit
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH] isa-fdc: assert replaced by proper error exit |
Date: |
Fri, 1 Sep 2017 13:37:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 01.09.2017 13:07, Eduardo Otubo wrote:
> When not available, isa-fdc falls into assert instead of proper error
> exit. This patch fixes this behavior.
>
> Signed-off-by: Eduardo Otubo <address@hidden>
> ---
> hw/block/fdc.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/hw/block/fdc.c b/hw/block/fdc.c
> index 401129073b..0b6def4e1d 100644
> --- a/hw/block/fdc.c
> +++ b/hw/block/fdc.c
> @@ -2699,11 +2699,15 @@ static void isabus_fdc_realize(DeviceState *dev,
> Error **errp)
> fdctrl->dma_chann = isa->dma;
> if (fdctrl->dma_chann != -1) {
> fdctrl->dma = isa_get_dma(isa_bus_from_device(isadev), isa->dma);
> - assert(fdctrl->dma);
> + if (!fdctrl->dma) {
> + error_setg(errp, "isa-fdc not supported");
> + goto error;
> + }
> }
>
> qdev_set_legacy_instance_id(dev, isa->iobase, 2);
> fdctrl_realize_common(dev, fdctrl, &err);
> +error:
> if (err != NULL) {
> error_propagate(errp, err);
> return;
Maybe add the reproducer to the commit message:
qemu-system-ppc64 -S -machine powernv -device isa-fdc
Reviewed-by: Thomas Huth <address@hidden>