Bug 1709627

Summary: qemu-kvm: util/oslib-posix.c:245: qemu_set_nonblock: Assertion `f != -1' failed.
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Pei Zhang <pezhang>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
qemu-kvm sub component: General QA Contact: Pei Zhang <pezhang>
Status: CLOSED DUPLICATE Docs Contact:
Severity: medium    
Priority: medium CC: chayang, jasowang, jen, jinzhao, juzhang, michen, rbalakri, virt-maint, xfu
Version: 8.1   
Target Milestone: rc   
Target Release: 8.1   
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: 2019-05-14 03:03:31 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 Pei Zhang 2019-05-14 02:34:45 UTC
Description of problem:
Boot qemu with vhostfd, qemu core dumped.


Version-Release number of selected component (if applicable):
4.18.0-83.el8.x86_64
qemu-kvm-4.0.0-0.module+el8.1.0+3169+3c501422.x86_64


How reproducible:
100%


Steps to Reproduce:

1. In host, boot qemu with vhostfd, qemu core dumped.

# /usr/libexec/qemu-kvm -device virtio-net-pci,mac=9a:a2:a3:a4:a5:a6,id=net0,netdev=hostnet0  -netdev tap,id=hostnet0,vhost=on,vhostfd=22
qemu-kvm: util/oslib-posix.c:245: qemu_set_nonblock: Assertion `f != -1' failed.


Actual results:
Qemu core dumped with vhostfd.


Expected results:
Qemu should not crash. It's more friendly to users by printing warning info like below. (This is testing with qemu-kvm-3.1.0-25.module+el8+3153+f1590ef7.x86_64)

qemu-kvm: -netdev tap,id=hostnet0,vhost=on,vhostfd=22: vhost_set_owner failed: Bad file descriptor (9)
qemu-kvm: -netdev tap,id=hostnet0,vhost=on,vhostfd=22: warning: vhost-net requested but could not be initialized


Additional info:

Comment 1 Pei Zhang 2019-05-14 03:03:31 UTC

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