Description of problem: Detach a console device from running guest should be rejected. Version-Release number of selected component (if applicable): libvirt-3.2.0-3.el7.x86_64 qemu-kvm-rhev-2.9.0-2.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.Start a guest with console device: #virsh dumpxml rhel7.3-min ... <console type='pty' tty='/dev/pts/13'> <source path='/dev/pts/13'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> ... 2.Prepare the console device xml: #cat console.xml <console type='pty' tty='/dev/pts/13'> <source path='/dev/pts/13'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> 3.Detach the console device from the guest: #virsh detach-device rhel7.3-min console.xml Device detached successfully 4.Check the active xml of the guest, the console device is not detached actually: #virsh dumpxml rhel7.3-min ... <console type='pty' tty='/dev/pts/13'> <source path='/dev/pts/13'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> ... 5.Detach the console device with --config, it failed: # virsh detach-device rhel7.3-min console.xml --config error: Failed to detach device from console.xml error: Requested operation is not valid: detaching serial console is not supported Actual results: Detach a console device from running guest returns successfully, but actually not detached. Expected results: Since detach a console device with --config is rejected, detach from the running guest should also be rejected.