Hide Forgot
Description of problem: The guest agent channel will always stay in disconnected status while re-attach guest agent to guest which just wakeup from dompmsuspended status Version-Release number of selected component (if applicable): libvirt-1.2.17-1.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.Start a guest with guest agent installing #virsh dumpxml 7.0 -- <pm> <suspend-to-mem enabled='yes'/> <suspend-to-disk enabled='yes'/> </pm> -- <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/7.0.org.qemu.guest_agent.0'/> <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/> <alias name='channel0'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> 2.After guest start successfully, do S3 with the guest # virsh dompmsuspend 7.0 --target mem Domain 7.0 successfully suspended # virsh list Id Name State ---------------------------------------------------- 26 7.0 pmsuspended 3.Prepare the guest agent xml #cat agent.xml <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/7.0.org.qemu.guest_agent.0'/> <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/> <alias name='channel1'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> 4.Detach the guest agent with agent xml, then wakeup the guest # virsh detach-device 7.0 agent.xml Device detached successfully # virsh dompmwakeup 7.0 Domain 7.0 successfully woken up # virsh list --all Id Name State ---------------------------------------------------- 26 7.0 running 5.Re-attach the guest agent to the guest, found the guest agent didn't stay in 'connected' status, also will fail to operate the virsh command which depends on guest agent #virsh attach-device 7.0 agent.xml #virsh dumpxml 7.0 -- <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/7.0.org.qemu.guest_agent.0'/> <target type='virtio' name='org.qemu.guest_agent.0'/> <alias name='channel0'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> # virsh domtime 7.0 error: Guest agent is not responding: QEMU guest agent is not connected 6.Restart libvirtd service, the guest agent will appears in 'disconnected' status #systemctl restart libvirtd # virsh dumpxml 7.0 |grep agent <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/7.0.org.qemu.guest_agent.0'/> <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/> # time virsh domtime 7.0 error: Guest agent is not responding: Guest agent not available for now real 0m5.009s user 0m0.006s sys 0m0.003s 7.Login in the guest, find the qemu-guest-agent service was in running status. Actual results: The guest agent channel will always stay in disconnected while re-attach guest agent to guest Expected results: The guest agent should be in connected status and works expectly after re-attach the guest agent to guest Additional info:
I've tried to reproduce the bug. An attempt to detach the device while the guest is in S3 state was successful so libvirt cleared the device from the XML. 2015-11-30 15:52:14.133+0000: 1548142: info : qemuMonitorIOWrite:526 : QEMU_MONITOR_IO_WRITE: mon=0x7f7e84004410 buf={"execute":"device_del","arguments":{"id":"channel0"},"id":"libvirt-99"} len=74 ret=74 errno=0 2015-11-30 15:52:14.134+0000: 1548142: info : qemuMonitorIOProcess:421 : QEMU_MONITOR_IO_PROCESS: mon=0x7f7e84004410 buf={"timestamp": {"seconds": 1448898734, "microseconds": 134281}, "event": "DEVICE_DELETED", "data": {"device": "channel0", "path": "/machine/peripheral/channel0"}} len=163 2015-11-30 15:52:14.134+0000: 1548142: debug : qemuMonitorJSONIOProcessLine:186 : Line [{"timestamp": {"seconds": 1448898734, "microseconds": 134281}, "event": "DEVICE_DELETED", "data": {"device": "channel0", "path": "/machine/peripheral/channel0"}}] 2015-11-30 15:52:14.134+0000: 1548142: info : qemuMonitorJSONIOProcessLine:201 : QEMU_MONITOR_RECV_EVENT: mon=0x7f7e84004410 event={"timestamp": {"seconds": 1448898734, "microseconds": 134281}, "event": "DEVICE_DELETED", "data": {"device": "channel0", "path": "/machine/peripheral/channel0"}} The device deleted event is returned immediately. After resuming the guest, the /dev/virtio-ports/ entry for the unplugged device, thus the device was removed without the OS knowing about it. Reassigning to qemu.
It looks like you're doing: 1. Start guest 2. Put guest in S3 state 3. Detach virtio-serial port 4. Resume guest Then this isn't expected to work normally, as Linux doesn't expect hardware to change while it's in suspend state. Marking this as NOTABUG, but please reopen if there's something else that's happening.