Bug 1001216 - Fix no_user or provide another way make devices unavailable with -device / device_add
Fix no_user or provide another way make devices unavailable with -device / de...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Markus Armbruster
Virtualization Bugs
:
: 1001222 (view as bug list)
Depends On:
Blocks: 1025958 720747 1001076 1001088 1001113 1001123 1001180 1001222
  Show dependency treegraph
 
Reported: 2013-08-26 14:51 EDT by Markus Armbruster
Modified: 2014-06-17 23:35 EDT (History)
5 users (show)

See Also:
Fixed In Version: qemu-kvm-1.5.3-15.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 06:54:24 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Markus Armbruster 2013-08-26 14:51:17 EDT
Description of problem:
We have a whole bunch of bugs calling for removing or disabling
unwanted devices.  Some of them are easy to remove, but others should
probably just be made unavailable with -device and device_add.  We
need a simple way to do that.

In RHEL-6's qemu-kvm, such a way exists: non-zero DeviceInfo member
no_user makes the device unavailable with -device and device_add.
Upstream silently broke this in commit 18b6dad.  Since then, all
no_user does is remove the device from -device help / device_add help.
Many devices still have no_user set, and many of them don't presently
work with -device.

In the (very) long run, all devices should be usable with -device, and
no_user should not exist.  But right now, they aren't, and no_user is
useful.  Let's fix it.

Libvirt uses QOM command qom-list-types to find available devices.  It
doesn't obey no_user.  As far as I can tell, QOM doesn't let you
figure out whether a device is no_user.  This needs to be addressed as
well.
Comment 1 Markus Armbruster 2013-08-26 15:00:39 EDT
Possibly useful for fixing bug 1001076, bug 1001088, bug 1001113, bug 1001180.
Comment 3 Markus Armbruster 2013-08-26 15:21:16 EDT
And for fixing bug 1001222.
Comment 4 Markus Armbruster 2013-11-02 09:29:57 EDT
The "libvirt needs to be able to detect no-user" (last paragraph in comment#0) split off into bug 1025958.
Comment 5 Miroslav Rezanina 2013-11-07 03:22:28 EST
Fix included in qemu-kvm-1.5.3-15.el7
Comment 7 Markus Armbruster 2013-11-14 03:08:09 EST
*** Bug 1001222 has been marked as a duplicate of this bug. ***
Comment 8 Markus Armbruster 2013-11-18 10:13:41 EST
Reproducer:

1. Run: qemu-kvm -nodefaults -S -display none -monitor stdio -device X
where X is a device marked "no-user" in output of monitor command "info qdm", e.g. PIIX3.

Actual results:

"-device X" is accepted.  For some but not all X, we then run into other trouble.  For instance, "-device PIIX3" reports "Can't create a second ISA bus".

Expected results:

"-device X" is rejected with message "Parameter 'driver' expects device type"

Additionally, please verify that all devices marked "no-user" in "info qdm" before the fix are still marked "no-user" afterwards.
Comment 9 huiqingding 2013-11-26 02:41:26 EST
Reproduce this bug using qemu-kvm-1.5.3-14.el7.x86_64

qemu-kvm and kernel version of host:
qemu-kvm-1.5.3-14.el7.x86_64
kernel-3.10.0-55.el7.x86_64

Step1 get all devices marked "no-user"
# /usr/libexec/qemu-kvm -nodefaults -S -display none -monitor stdio
(qemu) info qdm

We can get 31 devices marked "no-user" as following:
"isa-pit", "PIIX3-xen", "piix3-ide-xen", "kvm-pit", "PIIX3", "isa-pcspk", "isa-i8259", "i440FX-pcihost", "i440FX", "kvm-i8259","PIIX4_PM", "kvm-apic", "kvm-ioapic", "mc146818rtc", "i8042", "vmport", "kvmclock", "piix4-ide", "kvmvapic", "x86_64-cpu", "fw_cfg", "vmmouse", "ioapic",
"piix3-ide", "pvpanic", "isabus-bridge", "isa-fdc", "ICH9 SMB","ICH9 LPC", "apic", "port92",

Step2 run "qemu-kvm -nodefaults -S -display none -monitor stdio -device X", X is each device of above 31 devices. The results are same as "Actual results:" in Comment 8:
1) some devices is accepted without any error info, e.g. isa-pcspk, isa-i8259, kvm-i8259.
2) some devices reports "Can't create a second ISA bus", e.g. PIIX3-xen, PIIX3.
3) some devices reports "Segmentation fault (core dumped)", e.g. x86_64-cpu, apic.
4) some devices reports "qemu-kvm: -device X: Device initialization failed.", e.g. ioapic, kvm-ioapic.
Comment 10 huiqingding 2013-11-26 02:50:27 EST
Verify this bug using qemu-kvm-1.5.3-19.el7.x86_64.

qemu-kvm and kernel version of host:
qemu-kvm-1.5.3-19.el7.x86_64
kernel-3.10.0-55.el7.x86_64

Step1 get all devices marked "no-user"
# /usr/libexec/qemu-kvm -nodefaults -S -display none -monitor stdio
(qemu) info qdm

We can get 41 devices marked "no-user" as following:
"icc-bridge", "ICH9 LPC", "q35-pcihost", "exynos4210-ehci-usb", "xlnx,ps7-usb", "isa-fdc", "piix3-ide", "piix3-ide-xen", "piix4-ide", "SUNW,fdtwo", "sysbus-ahci", "sysbus-fdc", "ccid-card-emulated", "pci-serial-2x", "pci-serial-4x", "isa-cirrus-vga", "isa-pcspk", "apic", "fw_cfg", "i440FX", "i440FX-pcihost", "i8042", "ICH9 SMB","ioapic", "isa-i8259", "isa-pit", "isabus-bridge", "kvm-apic", "kvm-i8259", "kvm-ioapic", "kvm-pit", "kvmclock", "kvmvapic", "mc146818rtc", "PIIX3", "PIIX3-xen", "PIIX4_PM", "port92", "vmmouse", "vmport", "x86_64-cpu"

Step2 run "qemu-kvm -nodefaults -S -display none -monitor stdio -device X", X is each device of above 41 devices. The results are same as "Expected results:" in Comment 8:
"-device X" is rejected with message "Parameter 'driver' expects device type"

Based on the result of step2, I think this bug is fixed.
Comment 12 Ludek Smid 2014-06-13 06:54:24 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

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