summaryrefslogtreecommitdiffstats
path: root/hw/sd
diff options
context:
space:
mode:
authorPaolo Bonzini2020-10-06 14:38:55 +0200
committerPaolo Bonzini2020-10-12 17:50:50 +0200
commitbb755ba47f3747251c0eadf681ee68b9033309b8 (patch)
tree7d9a3c8a3f163876c62c7b0b79e6afc0aadc97e0 /hw/sd
parentqemu-iotests, qtest: rewrite test 067 as a qtest (diff)
downloadqemu-bb755ba47f3747251c0eadf681ee68b9033309b8.tar.gz
qemu-bb755ba47f3747251c0eadf681ee68b9033309b8.tar.xz
qemu-bb755ba47f3747251c0eadf681ee68b9033309b8.zip
qdev: add "check if address free" callback for buses
Check if an address is free on the bus before plugging in the device. This makes it possible to do the check without any side effects, and to detect the problem early without having to do it in the realize callback. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201006123904.610658-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/sd')
-rw-r--r--hw/sd/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/sd/core.c b/hw/sd/core.c
index 957d116f1a..08c93b5903 100644
--- a/hw/sd/core.c
+++ b/hw/sd/core.c
@@ -23,6 +23,7 @@
#include "hw/qdev-core.h"
#include "hw/sd/sd.h"
#include "qemu/module.h"
+#include "qapi/error.h"
#include "trace.h"
static inline const char *sdbus_name(SDBus *sdbus)
@@ -240,7 +241,7 @@ void sdbus_reparent_card(SDBus *from, SDBus *to)
readonly = sc->get_readonly(card);
sdbus_set_inserted(from, false);
- qdev_set_parent_bus(DEVICE(card), &to->qbus);
+ qdev_set_parent_bus(DEVICE(card), &to->qbus, &error_abort);
sdbus_set_inserted(to, true);
sdbus_set_readonly(to, readonly);
}