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

Laszlo Ersek lersek at redhat.com
Thu Sep 9 12:06:41 UTC 2021

On 09/09/21 13:35, Richard W.M. Jones wrote:
> 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:
>   https://github.com/libguestfs/libguestfs/blob/master/lib/qemu.c
> 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!)

Ah, OK! I didn't check.

> 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.

So yes, my R-b stands. Thanks!

More information about the Libguestfs mailing list