Bug 1967177

Summary: QEMU 6.0.0 socket_get_fd() fails with the error "socket_get_fd: too many connections"
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Stefan Hajnoczi <stefanha>
Component: qemu-kvmAssignee: Stefan Hajnoczi <stefanha>
qemu-kvm sub component: General QA Contact: Tingting Mao <timao>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: low CC: coli, jinzhao, juzhang, mrezanin, qinwang, rjones, virt-maint, ymankad, zixchen
Version: 8.5Keywords: ZStream
Target Milestone: rc   
Target Release: 8.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-6.0.0-19.module+el8.5.0+11385+6e7d542e Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1983113 (view as bug list) Environment:
Last Closed: 2021-11-16 07:53:43 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:
Bug Depends On:    
Bug Blocks: 1957194, 1983113    

Description Stefan Hajnoczi 2021-06-02 14:47:45 UTC
Description of problem:
A regression was introduced in QEMU 6.0.0 where socket file descriptor passing on the command-line no longer works. Rich Jones posted an example along these lines:

  $ qemu-storage-daemon --nbd-server addr.type=fd,addr.str=4
  qemu-storage-daemon: --nbd-server addr.type=fd,addr.str=4: socket_get_fd: too many connections: Invalid argument

This regression broke the libnbd test suite (see QEMU GitLab Issue link).

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. $ qemu-storage-daemon --nbd-server addr.type=fd,addr.str=4

Actual results:
qemu-storage-daemon: --nbd-server addr.type=fd,addr.str=4: socket_get_fd: too many connections: Invalid argument

Expected results:
qemu-storage-daemon: --nbd-server addr.type=fd,addr.str=4: File descriptor '4' is not a socket

Note that this is still an error message because we did not actually provide a file descriptor to the qemu-storage-daemon process. But this new error shows that QEMU has identified fd 4 and is trying to access it as expected.

Additional info:

Comment 3 zixchen 2021-06-04 01:31:02 UTC
Reproduce the bug on rhel8.5:

Version:
qemu-kvm-6.0.0-17.module+el8.5.0+11173+c9fce0bb.x86_64
kernel-4.18.0-310.el8.x86_64

Steps and results:
# qemu-storage-daemon --nbd-server addr.type=fd,addr.str=4
qemu-storage-daemon: --nbd-server addr.type=fd,addr.str=4: socket_get_fd: too many connections: Invalid argument

Comment 5 zixchen 2021-06-15 03:22:13 UTC
Verified this issue, report error as expected.

Version:
qemu-kvm-6.0.0-19.module+el8.5.0+11385+6e7d542e.x86_64
kernel-4.18.0-310.el8.x86_64

Steps:
# qemu-storage-daemon --nbd-server addr.type=fd,addr.str=4
qemu-storage-daemon: --nbd-server addr.type=fd,addr.str=4: File descriptor '4' is not a socket

The result is as expected, set status to verified.

Comment 6 Yanan Fu 2021-06-15 05:20:47 UTC
Set Verified:Tested,SanityOnly as gating/tier1 test pass.

Comment 11 errata-xmlrpc 2021-11-16 07:53:43 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 (virt:av 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-2021:4684