failover: qdev_device_add() returns err or dev set
Never both. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-8-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
594d308b93
commit
3d1c7a9782
@ -803,13 +803,6 @@ static void failover_add_primary(VirtIONet *n, Error **errp)
|
|||||||
if (err) {
|
if (err) {
|
||||||
qemu_opts_del(n->primary_device_opts);
|
qemu_opts_del(n->primary_device_opts);
|
||||||
}
|
}
|
||||||
if (n->primary_dev) {
|
|
||||||
if (err) {
|
|
||||||
qdev_unplug(n->primary_dev, &err);
|
|
||||||
qdev_set_id(n->primary_dev, "");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
error_setg(errp, "Primary device not found");
|
error_setg(errp, "Primary device not found");
|
||||||
error_append_hint(errp, "Virtio-net failover will not work. Make "
|
error_append_hint(errp, "Virtio-net failover will not work. Make "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user