Comment 15 for bug 1552241

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

While attaching:
$ perf record -e syscalls:sys_enter_open -R --pid 24846 --call-graph dwarf sleep 10
Gives:
            7fc9f16d8160 __opendir (/lib/x86_64-linux-gnu/libc-2.23.so)
            7fc9f665455c [unknown] (/lib/x86_64-linux-gnu/libudev.so.1.6.4)
            7fc9f664a5ac udev_enumerate_scan_devices (/lib/x86_64-linux-gnu/libudev.so.1.6.4)
            7fc9f2a4ab25 [unknown] (/lib/x86_64-linux-gnu/libusb-1.0.so.0.1.0)
            7fc9f2a486e1 [unknown] (/lib/x86_64-linux-gnu/libusb-1.0.so.0.1.0)
            7fc9f2a40b1d libusb_init (/lib/x86_64-linux-gnu/libusb-1.0.so.0.1.0)
              bd11d7a0f2 [unknown] (/usr/bin/qemu-system-x86_64)
              bd11d7b952 [unknown] (/usr/bin/qemu-system-x86_64)
              bd11d4c7e1 [unknown] (/usr/bin/qemu-system-x86_64)
              bd11c94bb5 [unknown] (/usr/bin/qemu-system-x86_64)
              bd11dd8e4e [unknown] (/usr/bin/qemu-system-x86_64)
              bd11ddccc1 object_property_set_qobject (/usr/bin/qemu-system-x86_64)
              bd11ddab60 object_property_set_bool (/usr/bin/qemu-system-x86_64)
              bd11c1544d qdev_device_add (/usr/bin/qemu-system-x86_64)

There were a lot, but it seems to be a loop within libusb.
So qemu uses libusb and libusb on udev_enumerate_scan_devices uses libudev.
That is on libusb_init called from qemu within the scope of a qdev_device_add.

This is in qemu's "usb_host_init" to initialize "static libusb_context *ctx;"
The apparmor denies kill it's internal representation of the devices and thereby make the attach fail.