diff mbox series

migration: failover: reset partially_hotplugged

Message ID 20210629152937.619193-1-lvivier@redhat.com
State New
Headers show
Series migration: failover: reset partially_hotplugged | expand

Commit Message

Laurent Vivier June 29, 2021, 3:29 p.m. UTC
When the card is plugged back, reset the partially_hotplugged flag to false

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1787194
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 hw/net/virtio-net.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Juan Quintela June 29, 2021, 5:43 p.m. UTC | #1
Laurent Vivier <lvivier@redhat.com> wrote:
> When the card is plugged back, reset the partially_hotplugged flag to false
>
> Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1787194
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  hw/net/virtio-net.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index bd7958b9f0ee..16d20cdee52a 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -3234,6 +3234,7 @@ static bool failover_replug_primary(VirtIONet *n, DeviceState *dev,
>          }
>          hotplug_handler_plug(hotplug_ctrl, dev, &err);
>      }
> +    pdev->partially_hotplugged = false;
>  
>  out:
>      error_propagate(errp, err);

Reviewed-by: Juan Quintela <quintela@redhat.com>


But while we are at this:
- In case hotplug_handler_pre_plug() fails, we don't reset it.
  No, I have no clue what is the right thing to in that error case.
  We have already plugged it once, so it should work (famous last
  words).

- Independent of this patch, we check if hotplug_ctrl is NULL, but
  nothing else on the tree check for that.
  Ok, device_set_realize() check it, but nothing else, except network
  failover.  I can't see how we are going to be able to arrive there and
  not having it, though.

Later, Juan.
Jason Wang July 6, 2021, 2:52 a.m. UTC | #2
在 2021/6/29 下午11:29, Laurent Vivier 写道:
> When the card is plugged back, reset the partially_hotplugged flag to false
>
> Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1787194
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>   hw/net/virtio-net.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index bd7958b9f0ee..16d20cdee52a 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -3234,6 +3234,7 @@ static bool failover_replug_primary(VirtIONet *n, DeviceState *dev,
>           }
>           hotplug_handler_plug(hotplug_ctrl, dev, &err);
>       }
> +    pdev->partially_hotplugged = false;
>   
>   out:
>       error_propagate(errp, err);


Acked-by: Jason Wang <jasowang@redhat.com>
diff mbox series

Patch

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index bd7958b9f0ee..16d20cdee52a 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3234,6 +3234,7 @@  static bool failover_replug_primary(VirtIONet *n, DeviceState *dev,
         }
         hotplug_handler_plug(hotplug_ctrl, dev, &err);
     }
+    pdev->partially_hotplugged = false;
 
 out:
     error_propagate(errp, err);