OSDN Git Service

hw/ide: Fix crash when plugging a piix3-ide device into the x-remote machine
authorThomas Huth <thuth@redhat.com>
Fri, 16 Apr 2021 12:52:56 +0000 (14:52 +0200)
committerThomas Huth <thuth@redhat.com>
Mon, 19 Jul 2021 08:08:45 +0000 (10:08 +0200)
commit9405d87be25db6dff4d7b5ab48a81bbf6d083e47
treec94429d30a760cfa44e04aad3c263e4a6f79bbbc
parent283f0a05e24a5e5fab78305f783f06215390d620
hw/ide: Fix crash when plugging a piix3-ide device into the x-remote machine

QEMU currently crashes when the user tries to do something like:

 qemu-system-x86_64 -M x-remote -device piix3-ide

This happens because the "isabus" variable is not initialized with
the x-remote machine yet. Add a proper check for this condition
and propagate the error to the caller, so we can fail there gracefully.

Message-Id: <20210416125256.2039734-1-thuth@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/ide/ioport.c
hw/ide/piix.c
hw/isa/isa-bus.c
include/hw/ide/internal.h
include/hw/isa/isa.h