fdc: Fix fallback=auto error handling
commit07a978ef376cde544cca564ec225a8eb79ff2d54
authorMarkus Armbruster <armbru@redhat.com>
Wed, 22 Apr 2020 13:07:11 +0000 (22 15:07 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 29 Apr 2020 06:01:52 +0000 (29 08:01 +0200)
treea9daf7bd2c400c72de3ab63775a56e22e0446683
parent0fbddcecf23dcc311b42d9faf87dc2656dadd62a
fdc: Fix fallback=auto error handling

fdctrl_realize_common() rejects fallback=auto.  Used by devices
"isa-fdc", "sysbus-fdc", "SUNW,fdtwo".  The error handling is broken:

    $ qemu-system-x86_64 -nodefaults -device isa-fdc,fallback=auto,driveA=fd0 -drive if=none,id=fd0
    **
    ERROR:/work/armbru/qemu/hw/block/fdc.c:434:pick_drive_type: assertion failed: (drv->drive != FLOPPY_DRIVE_TYPE_AUTO)
    Aborted (core dumped)

Cause: fdctrl_realize_common() neglects to bail out after setting the
error.  Fix that.

Fixes: a73275dd6fc3bfda33165bebc28e0c33c20cb0a0
Cc: John Snow <jsnow@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200422130719.28225-7-armbru@redhat.com>
hw/block/fdc.c