qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] Fix QEMU crash on vhost-user socket disconnect.
@ 2016-03-30 15:14 Ilya Maximets
  2016-03-30 15:14 ` [Qemu-devel] [PATCH 1/4] vhost-user: fix crash on " Ilya Maximets
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Ilya Maximets @ 2016-03-30 15:14 UTC (permalink / raw)
  To: qemu-devel, Michael S. Tsirkin; +Cc: Ilya Maximets, Jason Wang, Dyasly Sergey

Currently QEMU always crashes in following scenario (assume that
vhost-user application is Open vSwitch with 'dpdkvhostuser' port):

1. # Check that link in guest is in a normal state.
   [guest]# ip link show eth0
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc <...>
        link/ether 00:16:35:af:aa:4b brd ff:ff:ff:ff:ff:ff

2. # Kill vhost-user application (using SIGSEGV just to be sure).
   [host]# kill -11 `pgrep ovs-vswitchd`

3. # Check that guest still thinks that all is good.
   [guest]# ip link show eth0
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc <...>
        link/ether 00:16:35:af:aa:4b brd ff:ff:ff:ff:ff:ff

4. # Try to unbind virtio-pci driver and observe QEMU crash.
   [guest]# echo -n '0000:00:01.0' > /sys/bus/pci/drivers/virtio-pci/unbind
    qemu: Failed to read msg header. Read 0 instead of 12. Original request 11.
    qemu: Failed to read msg header. Read 0 instead of 12. Original request 11.
    qemu: Failed to read msg header. Read 0 instead of 12. Original request 11.

    Child terminated with signal = 0xb (SIGSEGV)
    GDBserver exiting

After the applying of this patch-set:

4. # Try to unbind virtio-pci driver. Unbind works fine with only few errors.
   [guest]# echo -n '0000:00:01.0' > /sys/bus/pci/drivers/virtio-pci/unbind
    qemu: Failed to read msg header. Read 0 instead of 12. Original request 11.
    qemu: Failed to read msg header. Read 0 instead of 12. Original request 11.

5. # Bind virtio-pci driver back.
   [guest]# echo -n '0000:00:01.0' > /sys/bus/pci/drivers/virtio-pci/bind

6. # Check link in guest. No crashes here, link in DOWN state.
   [guest]# ip link show eth0
    7: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc <...>
        link/ether 00:16:35:af:aa:4b brd ff:ff:ff:ff:ff:ff

7. QEMU may be gracefully restarted to restore communication after restarting
   of vhost-user application.

Ilya Maximets (4):
  vhost-user: fix crash on socket disconnect.
  vhost: prevent double stop of vhost_net device.
  vhost: check for vhost_net device validity.
  net: notify about link status only if it changed.

 hw/net/vhost_net.c             | 48 ++++++++++++++++++++++++++++++++++++++----
 hw/net/virtio-net.c            | 33 ++++++++++++++++++++++-------
 include/hw/virtio/virtio-net.h |  1 +
 include/net/vhost-user.h       |  1 +
 include/net/vhost_net.h        |  1 +
 net/filter.c                   |  1 +
 net/net.c                      |  7 +++---
 net/vhost-user.c               | 43 +++++++++++++++++++++++++++++--------
 8 files changed, 111 insertions(+), 24 deletions(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-04-05 10:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-30 15:14 [Qemu-devel] [PATCH 0/4] Fix QEMU crash on vhost-user socket disconnect Ilya Maximets
2016-03-30 15:14 ` [Qemu-devel] [PATCH 1/4] vhost-user: fix crash on " Ilya Maximets
2016-03-30 15:14 ` [Qemu-devel] [PATCH 2/4] vhost: prevent double stop of vhost_net device Ilya Maximets
2016-03-30 15:14 ` [Qemu-devel] [PATCH 3/4] vhost: check for vhost_net device validity Ilya Maximets
2016-03-30 15:14 ` [Qemu-devel] [PATCH 4/4] net: notify about link status only if it changed Ilya Maximets
2016-03-30 17:01 ` [Qemu-devel] [PATCH 0/4] Fix QEMU crash on vhost-user socket disconnect Michael S. Tsirkin
2016-03-31  6:02   ` Ilya Maximets
2016-03-31  9:21     ` Michael S. Tsirkin
2016-03-31 10:48       ` Ilya Maximets
2016-04-05 10:46     ` Michael S. Tsirkin

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).