RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2172098 - Support restarting passt process to preserve connectivity in case of inadvertent termination
Summary: Support restarting passt process to preserve connectivity in case of inadvert...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.2
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: yalzhang@redhat.com
URL:
Whiteboard:
Depends On: 2169232
Blocks: 2176923
TreeView+ depends on / blocked
 
Reported: 2023-02-21 13:44 UTC by Jaroslav Suchanek
Modified: 2023-07-26 08:39 UTC (History)
16 users (show)

Fixed In Version: libvirt-9.0.0-8.el9_2
Doc Type: Enhancement
Doc Text:
Clone Of: 2169232
: 2176923 (view as bug list)
Environment:
Last Closed: 2023-05-09 07:27:59 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker LIBVIRTAT-14245 0 None None None 2023-05-31 01:47:20 UTC
Red Hat Issue Tracker RHELPLAN-149530 0 None None None 2023-02-21 13:45:28 UTC
Red Hat Product Errata RHBA-2023:2171 0 None None None 2023-05-09 07:28:37 UTC

Description Jaroslav Suchanek 2023-02-21 13:44:17 UTC
+++ This bug was initially created as a clone of Bug #2169232 +++

An option to automatically reconnect a qemu stream socket back-end is now available:

    http://patchwork.ozlabs.org/project/qemu-devel/patch/20230119101645.2001683-1-lvivier@redhat.com/

and backporting this for RHEL 9.2 would benefit the libvirt integration (#2108965) of passt: libvirt could instruct qemu, at least by default, to reconnect to its socket network back-end so that, should passt terminate for any reason, the guest will be able to have functioning networking again as soon as libvirt restarts the passt daemon.

Comment 2 Laine Stump 2023-02-22 03:26:48 UTC
Patches posted upstream:

https://listman.redhat.com/archives/libvir-list/2023-February/238076.html

Comment 3 Laine Stump 2023-02-22 17:17:56 UTC
Pushed upstream:

commit 70747222a73ffed5cdadcab492bef67fe7e49aa4
Author: Peter Krempa <pkrempa>
Date:   Mon Feb 20 17:25:08 2023 +0100

    qemu: capabilities: Introduce QEMU_CAPS_NETDEV_STREAM_RECONNECT

commit acd8333f763f1e45728fac4e727fef4e33141ebf
Author: Laine Stump <laine>
Date:   Mon Feb 20 18:26:51 2023 -0500

    qemu: add reconnect=5 to passt qemu commandline options when available
    
commit f62ce81b8a57d8033be4c661e071cbd12b83bf7b (qemu-caps-netdev-reconnect-2)
Author: Laine Stump <laine>
Date:   Tue Feb 21 01:16:04 2023 -0500

    qemu: respond to NETDEV_STREAM_DISCONNECTED event
    
There may be other prerequisites.

Comment 4 Laine Stump 2023-02-23 19:04:06 UTC
I forgot that this patch is a prerequisite of the 2nd patch in the above list

commit 6db7b2d2ca6493e253394c218bc2d1fbae0193e9
Author: Peter Krempa <pkrempa>
Date:   Fri Jan 6 09:54:32 2023 +0100

    tests: qemucapabilitiesdata: Update for the qemu-8.0 development cycle

Comment 5 Laine Stump 2023-02-23 19:06:25 UTC
The above patches are a part of this MR that was filed against the rhel-9.2.0 branch:

  https://gitlab.com/redhat/rhel/src/libvirt/-/merge_requests/98

Comment 9 yalzhang@redhat.com 2023-03-07 01:54:44 UTC
Test on the scratch build libvirt-9.0.0-8.el9_rc.a7213e6de2.x86_64:
Kill passt process by "kill -9", and check the passt process will be started again after 5s, and network recovers on the vm, the result is as expected. 

1. start vm with passt backend interface:
$ virsh dumpxml vm1 --xpath //interface 
<interface type="user">
  <mac address="52:54:00:4e:92:81"/>
  <source dev="eno1"/>
  <model type="virtio"/>
  <backend type="passt" logFile="/home/test/passt.log"/>
  <alias name="net0"/>
  <acpi index="1"/>
  <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>

$ virsh start rhel

login the vm and run ping, keep it running:
# ping www.baidu.com
PING www.a.shifen.com (182.61.200.7) 56(84) bytes of data.
64 bytes from 182.61.200.7 (182.61.200.7): icmp_seq=1 ttl=255 time=4.48 ms
...

2. Then on another terminal, run stap to check proper qmp commands;

3. On 3nd termial, kill the passt process, and check if it started again:
$ ps aux | grep 'usr/bin/passt' | grep -v grep 
test       58195  0.0  0.0  76340 41264 ?        Ss   20:44   0:00 /usr/bin/passt --one-off --socket /home/test/.cache/libvirt/qemu/run/passt/2-vm1-net0.socket --mac-addr 52:54:00:4e:92:81 --pid /home/test/.cache/libvirt/qemu/run/passt/2-vm1-net0-passt.pid --interface eno1 --log-file /home/test/passt.log

$ kill -9  58195 ; ps aux | grep 'usr/bin/passt' | grep -v grep; sleep 5;  ps aux | grep 'usr/bin/passt' | grep -v grep
test       58262  0.0  0.0  76340 40356 ?        Ss   20:50   0:00 /usr/bin/passt --one-off --socket /home/test/.cache/libvirt/qemu/run/passt/2-vm1-net0.socket --mac-addr 52:54:00:4e:92:81 --pid /home/test/.cache/libvirt/qemu/run/passt/2-vm1-net0-passt.pid --interface eno1 --log-file /home/test/passt.log

check the outputs in the 2nd terminal:
#  stap /usr/share/doc/libvirt-docs/examples/systemtap/qemu-monitor.stp
  0.000 begin
411.894 ! 0x7f9b8c0b2740 {"timestamp": {"seconds": 1678153851, "microseconds": 476466}, "event": "NETDEV_STREAM_DISCONNECTED", "data": {"netdev-id": "hostnet0"}}
417.181 ! 0x7f9b8c0b2740 {"timestamp": {"seconds": 1678153856, "microseconds": 763555}, "event": "NETDEV_STREAM_CONNECTED", "data": {"netdev-id": "hostnet0", "addr": {"path": "/home/test/.cache/libvirt/qemu/run/passt/2-vm1-net0.socket", "type": "unix"}}}

And check on the vm, the ping recovers and continue running.

Comment 14 yalzhang@redhat.com 2023-03-29 06:49:25 UTC
Test with root user and unpriviledged user, with selinux enabled, and the steps in comment 9, the result is as expected.
Test with packages below:
$ rpm -q libvirt passt selinux-policy
libvirt-9.0.0-10.el9_2.x86_64
passt-0^20230222.g4ddbcb9-2.el9_2.x86_64
selinux-policy-38.1.11-2.el9_2.noarch

Comment 16 errata-xmlrpc 2023-05-09 07:27:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (libvirt bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2171


Note You need to log in before you can comment on or make changes to this bug.