[ovirt-users] qemu cgroup_controllers

Martin Polednik mpolednik at redhat.com
Fri Jun 3 09:24:12 UTC 2016


On 03/06/16 11:48 +0300, Дмитрий Глушенок wrote:
>Hello!
>
>Is it possible to tell libvirt to add specific devices to qemu cgroup? By somehow enumerating the devices in XML using a hook for example.
>I'm passing scsi-generic disks (/dev/sgX) to VM using qemucmdline hook and it doesn't work until I remove "devices" from cgroup_controllers in qemu.conf.

One way to achieve this is creating a hook to generate the scsi device
XML instead of modifying qemu cmdline directly. Libvirt assumes
ownership of all devices created in the XML and therefore adds them to
the machine cgroup.

Example of the XML taken from [1]:
<devices>
    <hostdev mode='subsystem' type='scsi' sgio='filtered' rawio='yes'>
        <source>
            <adapter name='scsi_host0'/>
            <address bus='0' target='0' unit='0'/>
        </source>
        <readonly/>
        <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </hostdev>
</devices>

There is slight issue with this approach outlined in [2].

If you want to keep the qemu approach, I think creating a custom
partition and moving devices there would be the cleanest approach. In
this case, [3] could help but I'm not entirely sure if that would
solve the issue.

[1] https://libvirt.org/formatdomain.html
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1325485
[3] https://libvirt.org/cgroups.html
>--
>Dmitry Glushenok
>Jet Infosystems
>http://www.jet.msk.su
>+7-495-411-7601 (ext. 1237)
>
>_______________________________________________
>Users mailing list
>Users at ovirt.org
>http://lists.ovirt.org/mailman/listinfo/users



More information about the Users mailing list