Bug 2227980

Summary: virtnetworkd.service is not triggered by socket after first deactivation
Product: Red Hat Enterprise Linux 9 Reporter: yalzhang <yalzhang>
Component: libvirtAssignee: Virtualization Maintenance <virt-maint>
libvirt sub component: Networking QA Contact: Virtualization Bugs <virt-bugs>
Status: CLOSED DUPLICATE Docs Contact:
Severity: medium    
Priority: unspecified CC: chwen, lvivier, pkrempa, smitterl, virt-maint, yafu
Version: 9.3Keywords: Regression, TestOnly
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-01 07:00:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description yalzhang@redhat.com 2023-08-01 03:12:17 UTC
This is the same issue with the one describled in upstream bug 2218987. Refer to bug 2218987 for more detail explainations.
This may be a systemd bug according to bug 2218987, will test again with new systemd package.

Description of problem:
"virsh net-list" command will hang forever

Version-Release number of selected component (if applicable):
libvirt-9.5.0-4.el9.x86_64
systemd-252-16.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Run "virsh net-list" command
# virsh net-list --all
2. If the above command succeeds and prints output within a couple of seconds, leave the system alone, and do not run any virsh commands. 
3. Wait for 2 minutes. 
4. Re-run command:
# virsh net-list --all
The command will hang and needs to be terminated with Ctrl+C.

check the virtnetworkd service is running:
# systemctl status virtnetworkd
● virtnetworkd.service - Virtualization network daemon
     Loaded: loaded (/usr/lib/systemd/system/virtnetworkd.service; disabled; preset: disabled)
     Active: active (running) since Mon 2023-07-31 22:54:34 EDT; 3min 33s ago
TriggeredBy: ● virtnetworkd.socket
             ● virtnetworkd-admin.socket
             ● virtnetworkd-ro.socket
.....

Actual Results: 
Command hangs indefinitely and needs to be terminated with Ctrl+C.

Expected results:
Virsh command should not hang

Additional info:

Comment 1 Peter Krempa 2023-08-01 07:00:14 UTC

*** This bug has been marked as a duplicate of bug 2225667 ***

Comment 2 chunfu wen 2023-08-04 09:36:18 UTC
observe similar situation in s390x platform, where virsh list is hanging 
Steps follow as:
1) Execute automation case:/usr/local/bin/avocado --show=test,app run --test-runner=runner --vt-type libvirt --vt-machine-type s390-virtio --vt-connect-uri qemu:///system virsh.console.normal_test.non_acl.valid_domname

2)Find that case is hanging in :Starting vm 'avocado-vt-vm1'

3) Open another terminal ssh to s390x host, and execute : virsh list --all
4) Finding that: virsh list --all is hanging 
5) After a few minutes, execute : virsh list --all  again ,finding failed to connect to the hypervisor and virtqemud service crashed

[root@s390x-kvm-virtqez2 ~]# virsh list --all
error: failed to connect to the hypervisor
error: Operation not supported: Cannot use direct socket mode if no URI is set

[root@s390x-kvm-virtqez2 ~]# systemctl status virtqemud
× virtqemud.service - Virtualization qemu daemon
     Loaded: loaded (/usr/lib/systemd/system/virtqemud.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Fri 2023-08-04 05:23:29 EDT; 6min ago
   Duration: 27min 1.868s
TriggeredBy: ○ virtqemud-ro.socket
             ○ virtqemud-admin.socket
             ○ virtqemud.socket
       Docs: man:virtqemud(8)
             https://libvirt.org
   Main PID: 7638 (code=exited, status=1/FAILURE)
        CPU: 577ms

Comment 3 chunfu wen 2023-08-04 09:36:40 UTC
observe similar situation in s390x platform, where virsh list is hanging 
Steps follow as:
1) Execute automation case:/usr/local/bin/avocado --show=test,app run --test-runner=runner --vt-type libvirt --vt-machine-type s390-virtio --vt-connect-uri qemu:///system virsh.console.normal_test.non_acl.valid_domname

2)Find that case is hanging in :Starting vm 'avocado-vt-vm1'

3) Open another terminal ssh to s390x host, and execute : virsh list --all
4) Finding that: virsh list --all is hanging 
5) After a few minutes, execute : virsh list --all  again ,finding failed to connect to the hypervisor and virtqemud service crashed

[root@s390x-kvm-virtqez2 ~]# virsh list --all
error: failed to connect to the hypervisor
error: Operation not supported: Cannot use direct socket mode if no URI is set

[root@s390x-kvm-virtqez2 ~]# systemctl status virtqemud
× virtqemud.service - Virtualization qemu daemon
     Loaded: loaded (/usr/lib/systemd/system/virtqemud.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Fri 2023-08-04 05:23:29 EDT; 6min ago
   Duration: 27min 1.868s
TriggeredBy: ○ virtqemud-ro.socket
             ○ virtqemud-admin.socket
             ○ virtqemud.socket
       Docs: man:virtqemud(8)
             https://libvirt.org
   Main PID: 7638 (code=exited, status=1/FAILURE)
        CPU: 577ms