summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Armbruster2020-04-22 15:07:11 +0200
committerMarkus Armbruster2020-04-29 08:01:52 +0200
commit07a978ef376cde544cca564ec225a8eb79ff2d54 (patch)
treea9daf7bd2c400c72de3ab63775a56e22e0446683
parentarm/virt: Fix virt_machine_device_plug_cb() error API violation (diff)
downloadqemu-07a978ef376cde544cca564ec225a8eb79ff2d54.tar.gz
qemu-07a978ef376cde544cca564ec225a8eb79ff2d54.tar.xz
qemu-07a978ef376cde544cca564ec225a8eb79ff2d54.zip
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>
-rw-r--r--hw/block/fdc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 33bc9e2f92..9628cc171e 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2615,6 +2615,7 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'");
+ return;
}
/* Fill 'command_to_handler' lookup table */