[Spice-devel] [Qemu-devel] [PATCH] RFC: qxl: allow to specify head limit to qxl driver
Frediano Ziglio
freddy77 at gmail.com
Tue Jun 9 08:03:10 PDT 2015
2015-06-09 10:43 GMT+01:00 Gerd Hoffmann <kraxel at redhat.com>:
> On Di, 2015-06-09 at 10:26 +0100, Frediano Ziglio wrote:
>> 2015-06-09 10:12 GMT+01:00 Gerd Hoffmann <kraxel at redhat.com>:
>> > On Di, 2015-06-09 at 09:49 +0100, Frediano Ziglio wrote:
>> >> This patch allow to limit number of heads using qxl driver. By default
>> >> qxl driver is not limited on any kind on head use so can decide to use
>> >> as much heads.
>> >
>> > There is a hard limit of 16 monitors in the qxl device ...
>> >
>>
>> Ok, didn't see it.
>
> The rom->client_monitors_config heads array has 16 entries, and I
> suspect the same limit could be in more places ...
>
In my header is 64 entries. Anyway, it has an hard limit.
>> >> + if (d->max_heads && d->max_heads <= 64) {
>> >> + rom->flags = cpu_to_le64(QXL_ROM_FLAG_MAX_HEADS);
>> >> + rom->max_heads = cpu_to_le16(d->max_heads);
>> >> + }
>> >
>> > rom does already carry information about the heads. How about simply
>> > applying the limit when filling rom->client_monitors_config in
>> > interface_client_monitors_config()?
>> >
>> > No device changes, no driver changes, alot less trouble.
>> >
>> > cheers,
>> > Gerd
>> >
>>
>> So what you are proposing is client should limit heads based on
>> spice-server limit and also spice-server should limit monitor received
>> from client.
>
> No. You'll add a new property like you did. In
> interface_client_monitors_config(), where qemu already checks it
> wouldn't overflow the 16 entries in the array it has, you additionally
> check for the configured limit.
>
> Which will filter the monitors_config sent from spice client to the
> guest to not carry more than $limit entries. So, if you configured two
> heads, and spice client says "fyi, I have three heads here ...", qemu
> will forward only two entries guests to the guest. Therefore the guest
> will use two heads them only, leaving the third unused.
>
> In theory spice-server could do the filtering too, but doing it in qemu
> is easier as you can easily pass in the limit as device property.
>
> cheers,
> Gerd
>
>
I did change in interface_client_monitors_config and also in
spice-server adding a new spice function to cap the monitor numbers
from guest to client. This is required as client base the
configuration it send based on the number of head available on the
guest. So faking the guest in spice-server in both directions make
client and guest happy. Yes, this does not require driver changes. I
added a function to spice-server so at least a bump of minor ABI
version is needed. I don't know if there are a function to set some
configuration that does not require a new ABI.
Frediano
More information about the Spice-devel
mailing list