Bug 1460086
| Summary: | No basic check for the cpu flag name for tcg or cpu mode is host-passthrough guest | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Luyao Huang <lhuang> |
| Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> |
| Status: | CLOSED ERRATA | QA Contact: | Luyao Huang <lhuang> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.4 | CC: | dyuan, lersek, rbalakri, xuzhang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-3.8.0-1.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-04-10 10:46:43 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: | 1199452 | ||
To anyone that lands here due to following the RHBZ URL in upstream libvirt commit 3596b1ddf912 ("qemu: report an error if usb keyboards are unsupported", 2017-06-09):
You are looking for bug 1460008 instead.
Patches sent upstream for review: https://www.redhat.com/archives/libvir-list/2017-September/msg00410.html Fixed upstream by:
commit 6ef9c202f2a158fa5e7ad6b2a7da853da55ac395
Refs: v3.7.0-91-g6ef9c202f2
Author: Jiri Denemark <jdenemar>
AuthorDate: Thu Sep 14 16:04:13 2017 +0200
Commit: Jiri Denemark <jdenemar>
CommitDate: Mon Sep 18 10:40:12 2017 +0200
cpu: Introduce virCPUValidateFeatures
This new API may be used to check whether all features used in a CPU
definition are valid (e.g., libvirt knows their name, their policy is
supported, etc.). Leaving this API unimplemented in an arch subdriver
means libvirt does not restrict CPU features usable on the associated
architectures.
Signed-off-by: Jiri Denemark <jdenemar>
commit 3f0193f7e5cc3fade291d5579354846dfba00972
Refs: v3.7.0-92-g3f0193f7e5
Author: Jiri Denemark <jdenemar>
AuthorDate: Thu Sep 14 16:07:59 2017 +0200
Commit: Jiri Denemark <jdenemar>
CommitDate: Mon Sep 18 10:40:12 2017 +0200
qemu: Validate guest CPU features before starting a domain
Signed-off-by: Jiri Denemark <jdenemar>
commit 20edbad7769df6bb23e1132aee186090db5e8856
Refs: v3.7.0-93-g20edbad776
Author: Jiri Denemark <jdenemar>
AuthorDate: Thu Sep 14 16:09:35 2017 +0200
Commit: Jiri Denemark <jdenemar>
CommitDate: Mon Sep 18 10:40:12 2017 +0200
cpu_s390: Implement virCPUValidateFeatures
Only feature policy is checked on s390, which was previously done in
virCPUUpdate, but that's not the correct place for the check once we
have virCPUValidateFeatures.
Signed-off-by: Jiri Denemark <jdenemar>
commit ea9741f6009c4654ed865314dfb1fce3eec5adb1
Refs: v3.7.0-94-gea9741f600
Author: Jiri Denemark <jdenemar>
AuthorDate: Thu Sep 14 16:14:40 2017 +0200
Commit: Jiri Denemark <jdenemar>
CommitDate: Mon Sep 18 10:40:12 2017 +0200
cpu_x86: Implement virCPUValidateFeatures
The function checks whether all CPU features used in a CPU definition
are specified in cpu_map.xml.
https://bugzilla.redhat.com/show_bug.cgi?id=1460086
Signed-off-by: Jiri Denemark <jdenemar>
Verify this bug with libvirt-3.9.0-7.el7.x86_64:
1. tcg guest + invalid cpu flag name + check is full:
# virsh dumpxml r7
<domain type='qemu'>
...
<cpu mode='host-model' check='full'>
<model fallback='allow'/>
<topology sockets='2' cores='4' threads='1'/>
<feature policy='require' name='notexisted'/>
2. start guest:
# virsh start vm1
error: Failed to start domain vm1
error: unsupported configuration: unknown CPU feature: notexisted
3. kvm guest + host-passthrough:
<cpu mode='host-passthrough' check='full'>
<feature policy='require' name='notexisted'/>
<numa>
<cell id='0' cpus='0-1' memory='512000' unit='KiB'/>
<cell id='1' cpus='2-3' memory='512000' unit='KiB'/>
</numa>
</cpu>
4.
# virsh start vm1
error: Failed to start domain vm1
error: unsupported configuration: unknown CPU feature: notexisted
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. https://access.redhat.com/errata/RHEA-2018:0704 |
Description of problem: No basic check for the cpu flag name for tcg or cpu mode is host-passthrough guest Version-Release number of selected component (if applicable): libvirt-3.2.0-9.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. tcg guest + invalid cpu flag name + check is full: # virsh dumpxml r7 <domain type='qemu'> ... <cpu mode='host-model' check='full'> <model fallback='allow'/> <topology sockets='2' cores='4' threads='1'/> <feature policy='require' name='notexisted'/> # virsh start r7 error: Failed to start domain r7 error: internal error: qemu unexpectedly closed the monitor: 2017-06-09T03:06:46.251886Z qemu-kvm: -chardev pty,id=charserial0: char device redirected to /dev/pts/1 (label charserial0) 2017-06-09T03:06:46.252285Z qemu-kvm: -chardev pty,id=charredir0: char device redirected to /dev/pts/2 (label charredir0) 2017-06-09T03:06:46.267520Z qemu-kvm: can't apply global Opteron_G4-x86_64-cpu.notexisted=on: Property '.notexisted' not found 2. kvm guest + host-passthrough : <cpu mode='host-passthrough' check='full'> <topology sockets='2' cores='4' threads='1'/> <feature policy='require' name='notexisted'/> <numa> <cell id='0' cpus='0-3' memory='512000' unit='KiB'/> <cell id='1' cpus='4-7' memory='512000' unit='KiB'/> </numa> </cpu> # virsh start r7 error: Failed to start domain r7 error: internal error: qemu unexpectedly closed the monitor: 2017-06-09T03:11:13.455183Z qemu-kvm: -chardev pty,id=charserial0: char device redirected to /dev/pts/1 (label charserial0) 2017-06-09T03:11:13.455562Z qemu-kvm: -chardev pty,id=charredir0: char device redirected to /dev/pts/2 (label charredir0) 2017-06-09T03:11:13.468983Z qemu-kvm: can't apply global host-x86_64-cpu.notexisted=on: Property '.notexisted' not found 3. Actual results: Libvirt could still validate that the XML uses valid feature names from our cpu_map.xml. Expected results: libvirt catch these invalid flags and report error earlier Additional info: