mirror of https://github.com/xemu-project/xemu.git
failover: primary bus is only used once, and where it is set
Just remove the struct member. Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <20201118083748.1328-5-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
587f2fcb93
commit
78274682b7
|
@ -804,7 +804,6 @@ static void failover_add_primary(VirtIONet *n, Error **errp)
|
|||
qemu_opts_del(n->primary_device_opts);
|
||||
}
|
||||
if (n->primary_dev) {
|
||||
n->primary_bus = n->primary_dev->parent_bus;
|
||||
if (err) {
|
||||
qdev_unplug(n->primary_dev, &err);
|
||||
qdev_set_id(n->primary_dev, "");
|
||||
|
@ -3118,6 +3117,7 @@ static bool failover_replug_primary(VirtIONet *n, Error **errp)
|
|||
Error *err = NULL;
|
||||
HotplugHandler *hotplug_ctrl;
|
||||
PCIDevice *pdev = PCI_DEVICE(n->primary_dev);
|
||||
BusState *primary_bus;
|
||||
|
||||
if (!pdev->partially_hotplugged) {
|
||||
return true;
|
||||
|
@ -3130,12 +3130,12 @@ static bool failover_replug_primary(VirtIONet *n, Error **errp)
|
|||
return false;
|
||||
}
|
||||
}
|
||||
n->primary_bus = n->primary_dev->parent_bus;
|
||||
if (!n->primary_bus) {
|
||||
primary_bus = n->primary_dev->parent_bus;
|
||||
if (!primary_bus) {
|
||||
error_setg(errp, "virtio_net: couldn't find primary bus");
|
||||
return false;
|
||||
}
|
||||
qdev_set_parent_bus(n->primary_dev, n->primary_bus, &error_abort);
|
||||
qdev_set_parent_bus(n->primary_dev, primary_bus, &error_abort);
|
||||
qatomic_set(&n->primary_should_be_hidden, false);
|
||||
if (!qemu_opt_set_bool(n->primary_device_opts,
|
||||
"partially_hotplugged", true, errp)) {
|
||||
|
|
|
@ -205,7 +205,6 @@ struct VirtIONet {
|
|||
QemuOpts *primary_device_opts;
|
||||
QDict *primary_device_dict;
|
||||
DeviceState *primary_dev;
|
||||
BusState *primary_bus;
|
||||
char *primary_device_id;
|
||||
char *standby_id;
|
||||
bool primary_should_be_hidden;
|
||||
|
|
Loading…
Reference in New Issue