[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 37/66] failover: remove failover_find_primary_device() error param
From: |
Michael S. Tsirkin |
Subject: |
[PULL 37/66] failover: remove failover_find_primary_device() error parameter |
Date: |
Tue, 8 Dec 2020 14:35:45 -0500 |
From: Juan Quintela <quintela@redhat.com>
It can never give one error.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20201118083748.1328-23-quintela@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/net/virtio-net.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index c708c03cf6..b994796734 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -832,7 +832,7 @@ static int is_my_primary(void *opaque, QemuOpts *opts,
Error **errp)
* @n: VirtIONet device
* @errp: returns an error if this function fails
*/
-static DeviceState *failover_find_primary_device(VirtIONet *n, Error **errp)
+static DeviceState *failover_find_primary_device(VirtIONet *n)
{
Error *err = NULL;
@@ -897,10 +897,7 @@ static void virtio_net_set_features(VirtIODevice *vdev,
uint64_t features)
qatomic_set(&n->failover_primary_hidden, false);
failover_add_primary(n, &err);
if (err) {
- n->primary_dev = failover_find_primary_device(n, &err);
- if (err) {
- goto out_err;
- }
+ n->primary_dev = failover_find_primary_device(n);
failover_add_primary(n, &err);
if (err) {
goto out_err;
@@ -3121,7 +3118,7 @@ static void virtio_net_handle_migration_primary(VirtIONet
*n,
should_be_hidden = qatomic_read(&n->failover_primary_hidden);
if (!n->primary_dev) {
- n->primary_dev = failover_find_primary_device(n, &err);
+ n->primary_dev = failover_find_primary_device(n);
if (!n->primary_dev) {
return;
}
--
MST
- [PULL 26/66] failover: remove standby_id variable, (continued)
- [PULL 26/66] failover: remove standby_id variable, Michael S. Tsirkin, 2020/12/08
- [PULL 27/66] failover: Remove primary_device_dict, Michael S. Tsirkin, 2020/12/08
- [PULL 23/66] failover: Rename bool to failover_primary_hidden, Michael S. Tsirkin, 2020/12/08
- [PULL 29/66] failover: simplify virtio_net_find_primary(), Michael S. Tsirkin, 2020/12/08
- [PULL 28/66] failover: Remove memory leak, Michael S. Tsirkin, 2020/12/08
- [PULL 30/66] failover: should_be_hidden() should take a bool, Michael S. Tsirkin, 2020/12/08
- [PULL 32/66] failover: virtio_net_connect_failover_devices() does nothing, Michael S. Tsirkin, 2020/12/08
- [PULL 31/66] failover: Rename function to hide_device(), Michael S. Tsirkin, 2020/12/08
- [PULL 33/66] failover: Rename to failover_find_primary_device(), Michael S. Tsirkin, 2020/12/08
- [PULL 34/66] failover: simplify qdev_device_add() failover case, Michael S. Tsirkin, 2020/12/08
- [PULL 37/66] failover: remove failover_find_primary_device() error parameter,
Michael S. Tsirkin <=
- [PULL 36/66] failover: make sure that id always exist, Michael S. Tsirkin, 2020/12/08
- [PULL 35/66] failover: simplify qdev_device_add(), Michael S. Tsirkin, 2020/12/08
- [PULL 38/66] failover: split failover_find_primary_device_id(), Michael S. Tsirkin, 2020/12/08
- [PULL 39/66] failover: We don't need to cache primary_device_id anymore, Michael S. Tsirkin, 2020/12/08
- [PULL 40/66] failover: Caller of this two functions already have primary_dev, Michael S. Tsirkin, 2020/12/08
- [PULL 42/66] failover: Remove primary_dev member, Michael S. Tsirkin, 2020/12/08
- [PULL 43/66] hw: add compat machines for 6.0, Michael S. Tsirkin, 2020/12/08
- [PULL 44/66] libvhost-user: replace qemu/bswap.h with glibc endian.h, Michael S. Tsirkin, 2020/12/08
- [PULL 47/66] libvhost-user: drop qemu/osdep.h dependency, Michael S. Tsirkin, 2020/12/08
- [PULL 45/66] libvhost-user: replace qemu/memfd.h usage, Michael S. Tsirkin, 2020/12/08