diff options
author | Juan Quintela <quintela@redhat.com> | 2020-11-18 09:37:25 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-12-08 13:48:57 -0500 |
commit | 78274682b79d48e8de76c817c67c3cfbb76dc2ee (patch) | |
tree | d58269b9126af9cce1de8c0f66a85b8d4f3c036b /hw | |
parent | 587f2fcb93eddf69736e00731a2da018a0e0a726 (diff) | |
download | qemu-78274682b79d48e8de76c817c67c3cfbb76dc2ee.zip |
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>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/net/virtio-net.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index a0fa63e7cb..786d313330 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -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)) { |