qdev/monitors: Fix reundant error_setg of qdev_add_device
There is an extra log "error_setg" in qdev_add_device(). When hot-plug a device, if the corresponding bus doesn't exist, it will trigger an asseration "assert(*errp == NULL)". Fixes: 515a7970490 (log: Add some logs on VM runtime path) Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com> Signed-off-by: Yan Wang <wangyan122@huawei.com> Signed-off-by: imxcc <xingchaochao@huawei.com> (cherry picked from commit 4a946ee5713758ec120126384e76e8eb8f6059a0)
This commit is contained in:
parent
151c21c2c7
commit
33f559a4de
31
qdev-monitors-Fix-reundant-error_setg-of-qdev_add_de.patch
Normal file
31
qdev-monitors-Fix-reundant-error_setg-of-qdev_add_de.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
From ada323e932c83271184a6ddba1cfd74a29378963 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Kunkun Jiang <jiangkunkun@huawei.com>
|
||||||
|
Date: Thu, 29 Jul 2021 15:24:48 +0800
|
||||||
|
Subject: [PATCH] qdev/monitors: Fix reundant error_setg of qdev_add_device
|
||||||
|
|
||||||
|
There is an extra log "error_setg" in qdev_add_device(). When
|
||||||
|
hot-plug a device, if the corresponding bus doesn't exist, it
|
||||||
|
will trigger an asseration "assert(*errp == NULL)".
|
||||||
|
|
||||||
|
Fixes: 515a7970490 (log: Add some logs on VM runtime path)
|
||||||
|
Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com>
|
||||||
|
Signed-off-by: Yan Wang <wangyan122@huawei.com>
|
||||||
|
---
|
||||||
|
softmmu/qdev-monitor.c | 1 -
|
||||||
|
1 file changed, 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
|
||||||
|
index dfd6429bf3..4a20f5dbd7 100644
|
||||||
|
--- a/softmmu/qdev-monitor.c
|
||||||
|
+++ b/softmmu/qdev-monitor.c
|
||||||
|
@@ -636,7 +636,6 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts,
|
||||||
|
if (path != NULL) {
|
||||||
|
bus = qbus_find(path, errp);
|
||||||
|
if (!bus) {
|
||||||
|
- error_setg(errp, "can not find bus for %s", driver);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (!object_dynamic_cast(OBJECT(bus), dc->bus_type)) {
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user