Bug 870003
| Summary: | libvirt should forbid deleting usb controller when guest with smartcard | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | hongming <honzhang> |
| Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.4 | CC: | acathrow, ajia, dallan, dyuan, eblake, jdenemar, jiahu, lnovich, mzhan, weizhan, zpeng |
| Target Milestone: | rc | Keywords: | Upstream |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-0.10.2-19.el6 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-11-21 08:34:09 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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 958929 | ||
|
Description
hongming
2012-10-25 10:33:26 UTC
Indeed - when smartcard was first added, -usb was unconditionally added; and when we changed the code to allow -usb to be omitted, we forgot to account for the impact it would have to smartcard that requires -usb. I don't think this is quite right. USB controller is supposed to always be there, unless the XMl explicitly says <controller type='usb' model='none'/>. However, we should of course forbid such configuration. That said, if the code worked in the way it was designed, just removing the controller element should have no effect. Another scenario 1. remove the usb controller from the running guest with smartcard 2. managed save the guest 3. can't start the guest unless remove the managedsave file manually and ccid controller. Patch proposed upstream: https://www.redhat.com/archives/libvir-list/2012-November/msg00049.html Moving to POST:
commit a95c9406a29aaba8fe21c4dca512dbc65942a29b
Author: Michal Privoznik <mprivozn>
AuthorDate: Mon Nov 5 12:12:04 2012 +0100
Commit: Michal Privoznik <mprivozn>
CommitDate: Tue Nov 6 10:11:35 2012 +0100
tests: Add test for controller order
commit 0f720ab35a1a836aa23b66ef4bafbc5e57290357
Author: Michal Privoznik <mprivozn>
AuthorDate: Mon Nov 5 11:51:44 2012 +0100
Commit: Michal Privoznik <mprivozn>
CommitDate: Tue Nov 6 10:11:34 2012 +0100
qemu: Add controllers in specified order
qemu is sensitive to the order of arguments passed. Hence, if a
device requires a controller, the controller cmd string must
precede device cmd string. The same apply for controllers, when
for instance ccid controller requires usb controller. So
controllers create partial ordering in which they should be added
to qemu cmd line.
commit 77b93dbc3e5fdffec60f631cd52c4dba0f2e0f29
Author: Michal Privoznik <mprivozn>
AuthorDate: Mon Nov 5 11:42:51 2012 +0100
Commit: Michal Privoznik <mprivozn>
CommitDate: Tue Nov 6 10:11:34 2012 +0100
qemu: Wrap controllers code into dummy loop
which just re-indent code and prepare it for next patch.
v1.0.0-36-ga95c940
This bug reproduced on libvirt-0.10.2-18.el6_4.9.x86_64 version, not reproduce on libvirt-0.10.2-19.el6.x86_64 version.
1. Added below xml to guest.
<controller type='ccid' index='0'/>
<smartcard mode='passthrough' type='spicevmc'>
<address type='ccid' controller='0' slot='0'/>
</smartcard>
2. start guest with old libvirt version after removing the usb controller.
[root@test1 ~]# rpm -q libvirt
libvirt-0.10.2-18.el6_4.9.x86_64
[root@test1 ~]# virsh start rhel6
error: Failed to start domain rhel6
error: internal error process exited while connecting to monitor: qemu-kvm: -device usb-ccid,id=ccid0: No 'USB' bus found for device 'usb-ccid'
3. start guest with the fixed libvirt version(libvirt-0.10.2-19.el6.x86_64) after removing the usb controller.
[root@test1 libvirt-0.10.2-19.el6]# virsh edit rhel6
Domain rhel6 XML configuration edited.
[root@test1 libvirt-0.10.2-19.el6]# virsh start rhel6
Domain rhel6 started
[root@test1 libvirt-0.10.2-19.el6]# virsh dumpxml rhel6 | grep -A5 usb
<controller type='usb' index='0'>
<alias name='usb0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='ccid' index='0'>
<alias name='ccid0'/>
</controller>
We can get the expected result, the guest can start, changed to verified.
Tested this bug on another scenario in comment 4. https://bugzilla.redhat.com/show_bug.cgi?id=870003#c4 Another scenario 1. remove the usb controller from the running guest with smartcard 2. managed save the guest 3. can't start the guest unless remove the managedsave file manually and ccid controller. This scenario can reproduced on libvirt-0.10.2-18.el6_4.9.x86_64 version, not reproduce on libvirt-0.10.2-19.el6.x86_64 and the latest version libvirt-0.10.2-21.el6. 1. Removed usb controller from the running guest with smartcard. virsh # edit r6 Domain r6 XML configuration edited. 2. Managed save the guest r6. virsh # managedsave r6 Domain r6 state saved by libvirt 3. Start the guest. virsh # start r6 Domain r6 started BR, Jianwei Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-1581.html |