Hotplug interface fail with null file descriptor
Software environment
- Operating system: fedora 35
- Architecture: x86_64
- kernel version: 5.17.4-200.fc35.x86_64
- libvirt version: V8.4.0-83-g215b2466
- Hypervisor and version: qemu-kvm-7.0.0-1.fc37.x86_64
Description of problem
Start a vm, and try to hotplug interface by attach-interface, it report error with null file descriptor
Steps to reproduce
- Start a vm
- Hotplug interface by:
# virsh attach-interface rhel network default --model virtio
error: Failed to attach interface
error: internal error: unable to execute QEMU command 'netdev_add': File descriptor named '(null)' has not been found
- check the libvirt log:
# cat /var/log/libvirt/libvirtd.log
...
2022-06-02 06:48:00.398+0000: 413311: info : qemuMonitorSend:887 : QEMU_MONITOR_SEND_MSG: mon=0x5597c0ac42f0 msg={"execute":"netdev_add","arguments":{"type":"tap","fd":"(null)","vhost":true,"vhostfd":"(null)","id":"hostnet1"},"id":"libvirt-419"}
fd=-1
2022-06-02 06:48:00.398+0000: 414565: info : virObjectRef:402 : OBJECT_REF: obj=0x5597c0ac42f0
2022-06-02 06:48:00.398+0000: 414565: info : qemuMonitorIOWrite:383 : QEMU_MONITOR_IO_WRITE: mon=0x5597c0ac42f0 buf={"execute":"netdev_add","arguments":{"type":"tap","fd":"(null)","vhost":true,"vhostfd":"(null)","id":"hostnet1"},"id":"libvirt-419"}
len=134 ret=134 errno=0
2022-06-02 06:48:00.398+0000: 414565: info : virObjectRef:402 : OBJECT_REF: obj=0x5597c0ac42f0
2022-06-02 06:48:00.398+0000: 414565: info : virObjectUnref:380 : OBJECT_UNREF: obj=0x5597c0ac42f0
2022-06-02 06:48:00.398+0000: 414565: info : virObjectUnref:380 : OBJECT_UNREF: obj=0x5597c0ac42f0
2022-06-02 06:48:00.399+0000: 414565: info : virObjectRef:402 : OBJECT_REF: obj=0x5597c0ac42f0
2022-06-02 06:48:00.399+0000: 414565: info : qemuMonitorJSONIOProcessLine:218 : QEMU_MONITOR_RECV_REPLY: mon=0x5597c0ac42f0 reply={"id": "libvirt-419", "error": {"class": "GenericError", "desc": "File descriptor named '(null)' has not been found"}}
Additional information
Edited by Yalan Zhang