On Wed, Dec 20, 2017 at 19:15:55 +0100, Markus Armbruster wrote: > "Daniel P. Berrange" <berra...@redhat.com> writes: > > > On Fri, Dec 15, 2017 at 05:38:00PM +0100, Max Reitz wrote: > > > >> Image creation in qemu-system-* vs. qemu-img: > >> In order to get proper introspection for qemu-img create, we need a > >> QAPI schema. If we have a QAPI schema, we might as well add > >> blockdev-create to QMP. > >> As long as we do not have a really-none (null, void, ...) machine type > >> for qemu-system-*, launching such a process just for creating an image > >> will bring quite a bit of overhead (e.g. with -M none -accel qtest). > >> However, as for libvirt, this is not exactly a regression since > >> libvirt currently cannot create images at all (apart from implicitly > >> through drive-mirror etc.). Further work on voidifying qemu-system-* > >> will improve performance. > > > > In terms of the I/O operations involved, image creation is a already a > > pretty slow process, particularly if pre-allocation is used which is > > common. So even QEMU's current slow (circa 300ms) startup time is a > > complete non-issue for image creation IMHO - it'll be dwarfed by the > > time to actually create the image. > > > >> On the other side, we can also add QAPI introspection to qemu-img. > >> (qemu-img already links to QAPI, so this should not be too hard.) > >> qemu-img will also need command-line introspection, though. > > > > I figure the qapi-ificiation is the hard & time consuming bit of > > work. Once that's done exporting it via both qemu-img & qemu-system* > > is quite straighforward. > > qemu-system-*: trivial. > qemu-img, via command line: straightforward > qemu-img, via QMP: more difficult, since QMP is entangled with HMP, > character devices, ... > > If libvirt really wants to use QMP for the job, *and* doesn't want to > use the qemu-system-* that's running a guest, the easy solution is > running another qemu-system-* without a guest.
QMP is necessary to have for very-long operations (blockdev-mirror), but for image creation the command line will be enough. Provided that interface for -blockdev and "create image" will be similar enough. Especially the fact that qemu-img create does not really like 'json:{}' thus some image options are impossible to pass (multiple hosts for gluster, ...).
signature.asc
Description: PGP signature