From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] RFC: -object vs -chardev creation order
Date: Tue, 17 Mar 2015 19:08:36 +0000 [thread overview]
Message-ID: <20150317190836.GP6540@redhat.com> (raw)
The current QEMU startup code will create -chardev backends first, then
create -object backends, then -fsdev backends and so on, in some pretty
arbitrary order of types.
There is already a dependancy from the rng-egd object type, which has a
link to a chardev, which requires -chardev options be processed before
-object options.
In my work to introduce an object type for TLS credentials though, we
encounter exactly the opposite dependancy. A -chardev option will
require that -object options be processed first, so that the TLS
credantials can be created.
This is a no-win situation. Both orders of creation are wrong for some
set of use cases. This is only going to get worse over time, as more
types of user creatable objects are defined.
The application invoking QEMU could easily solve it, by putting the
args on the command line in the order in which they need to processed,
but then QEMU throws away this ordering information and creates them
based on type of backend.
I'm unclear on whether anyone has thought about ways to solve this yet,
but it is a blocker for my work now, so I need to figure out some kind
of solution asap, even if only a temporary workaround.
One option is to convert the -chardev backends so they become user
creatable objects, and thus -object can obsolete use of -chardev
for these. This sounds simple, but I fear it could be a rather large
yak shaving exercise to get that done.
Another idea is to perhaps change the way options are stored, so that
instead of having a separate QemuOptsList for each type of option, have
one single list and store the type with each entry in the list. Then we
can iterate over the single list creating things in exactly the same
order that they were passed on the command line. I fear this may cause
regressions for apps using QEMU though - eg if some app is placing
'-object rng-egd' in the args, before the -chardev it would currently
work, but if we switch to honour ordering it would fail. We could
introduce a flag -strict-ordering but that feels gross in itself.
A third option is to not process -object args in one go, instead process
each type of object at a time. eg we'd first create all the
-object tls-credential instances, then create the -chardev instances,
then create the -object rng-egd instances. This is probably the least
amount of work in short term, but not all that scalable, unless we do
a catch-all default case, so we only need code up hacks for a few
particular object types.
Thus my gut feeling is to do option 3, but I'd like other opinions before
embarking on this....
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
next reply other threads:[~2015-03-17 19:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 19:08 Daniel P. Berrange [this message]
2015-03-18 7:32 ` [Qemu-devel] RFC: -object vs -chardev creation order Paolo Bonzini
2015-03-18 9:43 ` Markus Armbruster
2015-03-18 9:59 ` Daniel P. Berrange
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150317190836.GP6540@redhat.com \
--to=berrange@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).