[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [RFC] On present using dummy hostdev usb device

Hi, all!

  We use an interesting approach when starting/migrating/etc domain with usb
hostdev with startupPolicy=optional. We add qemu usb-host device with
missing hostaddr/hostbus parameters (dummy device). I guess there are
2 reasons why we do it. First without dummy device migration will fail as
described in [1]. Second is an interesting property of dummy device that
qemu starts to monitor for attaching of usb devices and binds the first
attached to node to the dummy device. So one can start a domain with
missing hostdev and attach it later or migrate a domain then detach
hostdev on source and attach it on destination. But as qemu binds the
first attached device this is not reliable, to say the least. And after
all this does not work if domain uses distinct mount namespace which
is default.

  So I question does it make sense to use dummy device at all? In case of
migration/resume from suspend/revert to snapshot we can either fix qemu to
ignore incoming missing hostdev data or add dummy device temporarily. The
latter solution is worse as it brings dummy device behaviour even for a short
period of time. However having a temporary dummy device is neccessary step
towards the time when all supported versions of qemu do the mentioned ignoring.
As to handling attaching of missing hostdev device to node it should be done in
libvirt which can do necessary mount namespace actions. (Actually I developing
such patches right now but some peculiarities of dummy device bring me here).


[1] https://www.redhat.com/archives/libvir-list/2012-October/msg00440.html

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]