[Libguestfs] [PATCH] lib: direct: Remove use of sga

Richard W.M. Jones rjones at redhat.com
Thu Sep 9 11:35:12 UTC 2021

On Thu, Sep 09, 2021 at 01:11:09PM +0200, Laszlo Ersek wrote:
> How does libguestfs deal with different QEMU versions / QEMU feature
> deprecation? Is there some kind of feature detection?

Kind of, but it's only grepping the output of -help, -device \?,
and/or looking at QMP output of "query-qmp-schema" and "query-kvm".

The code is in:


As qemu has settled down over time and libguestfs uses only a
well-established set of features, this kind of feature detection has
become less and less interesting.  (So quite unlike libvirt where
they're always trying to catch up with the latest qemu features).  At
some point we might just say "use qemu >= VERSION" and have done with it.

> For example, why would it be less good to implement the change as follows:
>   if (g->verbose) {
>     if (guestfs_int_qemu_supports_device(...) {
>       arg ("-device", "sga");
>     } else {
> #if defined(__i386__) || defined(__x86_64__)
>       arg ("-machine", "graphics=off");
> #endif
>     }

I think in this case it's my understanding that the "new" (from RHEL 7!)
seabios graphics feature is just better than SGA, and so we might as
well use it all the time even if SGA is available.  That was my
understanding from talking to Gerd anyhow.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.

More information about the Libguestfs mailing list