mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
qdev/qbus: remove failover specific code
Commit f3a8505656 ("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>
This commit is contained in:
committed by
Michael S. Tsirkin
parent
515efffc2f
commit
bcfc906be4
@@ -3299,7 +3299,17 @@ static bool failover_hide_primary_device(DeviceListener *listener,
|
||||
if (!device_opts) {
|
||||
return false;
|
||||
}
|
||||
standby_id = qdict_get_try_str(device_opts, "failover_pair_id");
|
||||
|
||||
if (!qdict_haskey(device_opts, "failover_pair_id")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!qdict_haskey(device_opts, "id")) {
|
||||
error_setg(errp, "Device with failover_pair_id needs to have id");
|
||||
return false;
|
||||
}
|
||||
|
||||
standby_id = qdict_get_str(device_opts, "failover_pair_id");
|
||||
if (g_strcmp0(standby_id, n->netclient_name) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user