From: Laurent Vivier <lvivier@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: Re: [PULL 09/10] virtio-net: failover: add missing remove_migration_state_change_notifier()
Date: Tue, 18 May 2021 12:09:37 +0200 [thread overview]
Message-ID: <93ca1ecd-8a0d-d1ef-ff2b-f411c200ac98@redhat.com> (raw)
In-Reply-To: <1620458319-5670-10-git-send-email-jasowang@redhat.com>
Hi Jason,
do you plan to resend the PR?
Thanks,
Laurent
On 08/05/2021 09:18, Jason Wang wrote:
> From: Laurent Vivier <lvivier@redhat.com>
>
> In the failover case configuration, virtio_net_device_realize() uses an
> add_migration_state_change_notifier() to add a state notifier, but this
> notifier is not removed by the unrealize function when the virtio-net
> card is unplugged.
>
> If the card is unplugged and a migration is started, the notifier is
> called and as it is not valid anymore QEMU crashes.
>
> This patch fixes the problem by adding the
> remove_migration_state_change_notifier() in virtio_net_device_unrealize().
>
> The problem can be reproduced with:
>
> $ qemu-system-x86_64 -enable-kvm -m 1g -M q35 \
> -device pcie-root-port,slot=4,id=root1 \
> -device pcie-root-port,slot=5,id=root2 \
> -device virtio-net-pci,id=net1,mac=52:54:00:6f:55:cc,failover=on,bus=root1 \
> -monitor stdio disk.qcow2
> (qemu) device_del net1
> (qemu) migrate "exec:gzip -c > STATEFILE.gz"
>
> Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
> 0x0000000000000000 in ?? ()
> (gdb) bt
> #0 0x0000000000000000 in ()
> #1 0x0000555555d726d7 in notifier_list_notify (...)
> at .../util/notify.c:39
> #2 0x0000555555842c1a in migrate_fd_connect (...)
> at .../migration/migration.c:3975
> #3 0x0000555555950f7d in migration_channel_connect (...)
> error@entry=0x0) at .../migration/channel.c:107
> #4 0x0000555555910922 in exec_start_outgoing_migration (...)
> at .../migration/exec.c:42
>
> Reported-by: Igor Mammedov <imammedo@redhat.com>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> Signed-off-by: Jason Wang <jasowang@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 7ed11a3..dc71aa8 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -3480,6 +3480,7 @@ static void virtio_net_device_unrealize(DeviceState *dev)
>
> if (n->failover) {
> device_listener_unregister(&n->primary_listener);
> + remove_migration_state_change_notifier(&n->migration_state);
> }
>
> max_queues = n->multiqueue ? n->max_queues : 1;
>
next prev parent reply other threads:[~2021-05-18 10:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-08 7:18 [PULL 00/10] Net patches Jason Wang
2021-05-08 7:18 ` [PULL 01/10] net/tap: Added TUNSETSTEERINGEBPF code Jason Wang
2021-05-08 7:18 ` [PULL 02/10] net: Added SetSteeringEBPF method for NetClientState Jason Wang
2021-05-08 7:18 ` [PULL 03/10] ebpf: Added eBPF RSS program Jason Wang
2021-05-08 7:18 ` [PULL 04/10] ebpf: Added eBPF RSS loader Jason Wang
2021-05-08 7:18 ` [PULL 05/10] virtio-net: Added eBPF RSS to virtio-net Jason Wang
2021-05-08 7:18 ` [PULL 06/10] docs: Added eBPF documentation Jason Wang
2021-05-08 7:18 ` [PULL 07/10] MAINTAINERS: Added eBPF maintainers information Jason Wang
2021-05-08 7:18 ` [PULL 08/10] hw/net/imx_fec: return 0xffff when accessing non-existing PHY Jason Wang
2021-05-08 7:18 ` [PULL 09/10] virtio-net: failover: add missing remove_migration_state_change_notifier() Jason Wang
2021-05-18 10:09 ` Laurent Vivier [this message]
2021-05-08 7:18 ` [PULL 10/10] tap-bsd: Remove special casing for older OpenBSD releases Jason Wang
2021-05-08 7:31 ` [PULL 00/10] Net patches no-reply
2021-05-08 7:59 ` Jason Wang
2021-05-11 20:20 ` Peter Maydell
2021-05-12 2:53 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=93ca1ecd-8a0d-d1ef-ff2b-f411c200ac98@redhat.com \
--to=lvivier@redhat.com \
--cc=jasowang@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).