Bug 1447183 - Detach a console device from running guest should be rejected
Summary: Detach a console device from running guest should be rejected
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-02 04:11 UTC by yafu
Modified: 2023-10-16 08:38 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description yafu 2017-05-02 04:11:58 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.