Bug 1685541

Summary: virt-xml: teach it to handle the console+serial duplication magic when removing either device
Product: [Community] Virtualization Tools Reporter: Katerina Koukiou <kkoukiou>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: berrange, crobinso, gscrivan
Target Milestone: ---   
Target Release: ---   
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: 2020-09-08 23:34:07 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 Katerina Koukiou 2019-03-05 12:51:29 UTC
Description of problem:
`virt-xml myGuest --remove-device X` can remove only one device element at a call.
However some devices like the first serial and console devices should be removed together otherwise removing one of them will not have any effect to the guest.

How reproducible:
Always

Steps to Reproduce:
1. virt-xml testVm --remove-device --serial pty
2. virt-xml testVm --remove-device --console pty

Actual results:

`virsh dumpxml testVm` to confirm the serial and console pty is still there.

Expected results:
Removing either the serial or the console device should remove both from the guest's XML.
virt-xml should probably special case the  the serial device handling to remove the second device automatically if one the the two is marked for removal.

Comment 1 Cole Robinson 2019-03-05 15:29:07 UTC
We have some special purpose logic for doing this in virtManager/domain.py, we need to get that into virtinst/ somehow it can be shared with virt-xml

Comment 2 Cole Robinson 2020-09-08 23:34:07 UTC
Fixed upstream now:

commit 44033b43bbda487bf8962f7d74de107f96aa2f47
Author: Cole Robinson <crobinso>
Date:   Tue Sep 8 17:55:09 2020 -0400

    virt-xml: Handle removing <console> <serial> dup device