aboutsummaryrefslogtreecommitdiff
path: root/hw/sd
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-10-06 15:38:55 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2020-10-12 11:50:50 -0400
commitbb755ba47f3747251c0eadf681ee68b9033309b8 (patch)
tree7d9a3c8a3f163876c62c7b0b79e6afc0aadc97e0 /hw/sd
parentd8a18da56df93b7f778fb97ba370031597d19ffd (diff)
downloadqemu-bb755ba47f3747251c0eadf681ee68b9033309b8.zip
qemu-bb755ba47f3747251c0eadf681ee68b9033309b8.tar.gz
qemu-bb755ba47f3747251c0eadf681ee68b9033309b8.tar.bz2
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 957d116..08c93b5 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);
}