提交 327867b6 编写于 作者: M Markus Armbruster

qdev: Fix -device and device_add to handle unsuitable bus gracefully

"device_add isa-serial,bus=pci.0" kills QEMU.  Not good.
上级 0f0bc3f1
......@@ -204,6 +204,11 @@ DeviceState *qdev_device_add(QemuOpts *opts)
path = qemu_opt_get(opts, "bus");
if (path != NULL) {
bus = qbus_find(path);
if (bus && bus->info != info->bus_info) {
error_report("Device '%s' can't go on a %s bus",
driver, bus->info->name);
return NULL;
}
} else {
bus = qbus_find_recursive(main_system_bus, NULL, info->bus_info);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册