aboutsummaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2021-10-19 09:15:32 +0200
committerMichael S. Tsirkin <mst@redhat.com>2021-10-20 04:37:55 -0400
commitbcfc906be47a88803307cd6b665dc4c26fdd6dd2 (patch)
treef3c02e2f420ddbfa8e691c37c3dbae6f3b6b870c /softmmu
parent515efffc2fd0928317a0a1ec47b28a972c40ddad (diff)
qdev/qbus: remove failover specific code
Commit f3a850565693 ("qdev/qbus: add hidden device support") has introduced a generic way to hide a device but it has modified qdev_device_add() to check a specific option of the failover device, "failover_pair_id", before calling the generic mechanism. It's not needed (and not generic) to do that in qdev_device_add() because this is also checked by the failover_hide_primary_device() function that uses the generic mechanism to hide the device. Cc: Jens Freimann <jfreimann@redhat.com> Signed-off-by: Laurent Vivier <lvivier@redhat.com> Message-Id: <20211019071532.682717-3-lvivier@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/qdev-monitor.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
index 89c473cb22..4851de51a5 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -639,19 +639,13 @@ DeviceState *qdev_device_add_from_qdict(const QDict *opts,
}
}
- if (qdict_haskey(opts, "failover_pair_id")) {
- if (!qdict_haskey(opts, "id")) {
- error_setg(errp, "Device with failover_pair_id don't have id");
- return NULL;
- }
- if (qdev_should_hide_device(opts, from_json, errp)) {
- if (bus && !qbus_is_hotpluggable(bus)) {
- error_setg(errp, QERR_BUS_NO_HOTPLUG, bus->name);
- }
- return NULL;
- } else if (*errp) {
- return NULL;
+ if (qdev_should_hide_device(opts, from_json, errp)) {
+ if (bus && !qbus_is_hotpluggable(bus)) {
+ error_setg(errp, QERR_BUS_NO_HOTPLUG, bus->name);
}
+ return NULL;
+ } else if (*errp) {
+ return NULL;
}
if (phase_check(PHASE_MACHINE_READY) && bus && !qbus_is_hotpluggable(bus)) {