On 02/06/2015 04:12 PM, Stefan Berger wrote:
it's not that simple unfortunately; if we started to re-order / re-map
using dup() the file descriptors then all fd's that make it onto the
command line, like those for -netdev and others, also need to be adapted
to have that re-ordered fd on the command line.
Correct, and that's what I hope to accomplish by making fd registration
enforce that the caller check the return value, to make sure that
-netdev is now constructing the command line with the fd the child will
see rather than what the parent owns. Yes, it means auditing all
existing callers.
Conversely, this
currently prevents us from ordering the file descriptors as well, since
nothing would work without code change. So ordering the file descriptors
cannot currently be done with anything that builds up a QEMU command
line. So do we really need to re-order them then as part of this code
change?
I think that a pre-req series that orders fds in the child for all
callers, independent of adding your new TPM features, will be a good
thing in the long run. So I'm currently working on said series. :)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org