From 78274682b79d48e8de76c817c67c3cfbb76dc2ee Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 18 Nov 2020 09:37:25 +0100 Subject: failover: primary bus is only used once, and where it is set Just remove the struct member. Signed-off-by: Juan Quintela Message-Id: <20201118083748.1328-5-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-net.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/hw/virtio/virtio-net.h') diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index f4852ac27b..c8da637d40 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -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; -- cgit v1.2.3 From e2bde83e23d3cfc1d90911c74500fd2e3b0b04fa Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 18 Nov 2020 09:37:29 +0100 Subject: failover: Rename bool to failover_primary_hidden You should not use passive naming variables. And once there, be able to search for them. Signed-off-by: Juan Quintela Message-Id: <20201118083748.1328-9-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-net.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/hw/virtio/virtio-net.h') diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index c8da637d40..ca68be759f 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -207,7 +207,8 @@ struct VirtIONet { DeviceState *primary_dev; char *primary_device_id; char *standby_id; - bool primary_should_be_hidden; + /* primary failover device is hidden*/ + bool failover_primary_hidden; bool failover; DeviceListener primary_listener; Notifier migration_state; -- cgit v1.2.3 From 19e49bc2e984bd065719fc3595f35368b3ae87cd Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 18 Nov 2020 09:37:31 +0100 Subject: failover: Remove primary_device_opts It was really only used once, in failover_add_primary(). Just search for it on global opts when it is needed. Signed-off-by: Juan Quintela Message-Id: <20201118083748.1328-11-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-net.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/hw/virtio/virtio-net.h') diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index ca68be759f..7159e6c0a0 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -202,7 +202,6 @@ struct VirtIONet { AnnounceTimer announce_timer; bool needs_vnet_hdr_swap; bool mtu_bypass_backend; - QemuOpts *primary_device_opts; QDict *primary_device_dict; DeviceState *primary_dev; char *primary_device_id; -- cgit v1.2.3 From 4f0303aed87f83715055e558176046a8a3d9b987 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 18 Nov 2020 09:37:32 +0100 Subject: failover: remove standby_id variable We can calculate it, and we only use it once anyways. Signed-off-by: Juan Quintela Message-Id: <20201118083748.1328-12-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-net.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/hw/virtio/virtio-net.h') diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index 7159e6c0a0..a055f39dd6 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -205,7 +205,6 @@ struct VirtIONet { QDict *primary_device_dict; DeviceState *primary_dev; char *primary_device_id; - char *standby_id; /* primary failover device is hidden*/ bool failover_primary_hidden; bool failover; -- cgit v1.2.3 From 9673a88e97d1eb428872bd261dbf56a0f3c2fd71 Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 18 Nov 2020 09:37:33 +0100 Subject: failover: Remove primary_device_dict It was only used once. And we have there opts->id, so no need for it. Signed-off-by: Juan Quintela Message-Id: <20201118083748.1328-13-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-net.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/hw/virtio/virtio-net.h') diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index a055f39dd6..fe353d8299 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -202,7 +202,6 @@ struct VirtIONet { AnnounceTimer announce_timer; bool needs_vnet_hdr_swap; bool mtu_bypass_backend; - QDict *primary_device_dict; DeviceState *primary_dev; char *primary_device_id; /* primary failover device is hidden*/ -- cgit v1.2.3 From 3abad4a221e050d43fa8540677b285057642baaf Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 18 Nov 2020 09:37:45 +0100 Subject: failover: We don't need to cache primary_device_id anymore Signed-off-by: Juan Quintela Message-Id: <20201118083748.1328-25-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-net.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/hw/virtio/virtio-net.h') diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index fe353d8299..efef64e02f 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -203,7 +203,6 @@ struct VirtIONet { bool needs_vnet_hdr_swap; bool mtu_bypass_backend; DeviceState *primary_dev; - char *primary_device_id; /* primary failover device is hidden*/ bool failover_primary_hidden; bool failover; -- cgit v1.2.3 From 21e8709b29cd981c74565e75276ed476c954cbbf Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Wed, 18 Nov 2020 09:37:48 +0100 Subject: failover: Remove primary_dev member Only three uses remained, and we can remove them on that case. Signed-off-by: Juan Quintela Message-Id: <20201118083748.1328-28-quintela@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-net.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/hw/virtio/virtio-net.h') diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index efef64e02f..7e96d193aa 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -202,7 +202,6 @@ struct VirtIONet { AnnounceTimer announce_timer; bool needs_vnet_hdr_swap; bool mtu_bypass_backend; - DeviceState *primary_dev; /* primary failover device is hidden*/ bool failover_primary_hidden; bool failover; -- cgit v1.2.3