[...]
>>
>> By the way the patch works only for -blockdev configuration which is
>> available since QEMU 2.10 AFAIK. So we could purse to support 2.10, 2.11,
>> 2.12 and 3.0 version in principle.
>
> Ah true, the --blockdev option is required.
>
> I've put the "artificial" point in time of 2.12 because that when I
> recall Berto making adjustments to the cache size algorithms and when
> the @l2-cache-entry-size appeared in qapi/block-core.json. I think prior
> to those changes the algorithm was even more difficult to decipher.
>
UPDATE
Turns out -blockdev will be supported only starting from QEMU 3.0.0 according
to [1]. I thought 2.10 and further versions will be supported too because grepped
'qdev' in tests/qemucapabilitiesdata/ - turns out I found support for
query-block command :)
So I think extra complexity to support just 3.0.0 is unnessesary.
Nikolay
Since I see you pinged on public IRC - I'm OK with using -blockdev as
the base - it's the "implementation detail" that perhaps can be noted
when deciding whether to apply/support the cache size. I think then the
only 'difference' would be the QEMU 3.1 change that allows for a more
true maximum value. Since that "detail" would/should be hidden from
consumers, maybe you just use that QEMU_CAPS_QCOW2_L2_CACHE_SIZE value
to determine whether some arbitrarily, but algorithmic value is used or
if the cap is there just use INT64_MAX. And by the former I mean,
consider what the default values are, do some math and use that as the
max with the appropriate explanation.
John
Also just so you're aware - like many other Red Hat associates, I'm
"technically" on vacation until after Jan 1. It's our annual shutdown
period and while
[1] [PATCHv2 62/62] DO NOT APPLY: Enable QEMU_CAPS_BLOCKDEV if 'query-blockstats'
works with -blockdev
https://www.redhat.com/archives/libvir-list/2018-August/msg00755.html
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1307,6 +1307,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[]
= {
{ "blockdev-add/arg-type/+qcow2/encrypt/+luks/key-secret",
QEMU_CAPS_QCOW2_LUKS },
{ "nbd-server-start/arg-type/tls-creds", QEMU_CAPS_NBD_TLS },
{ "screendump/arg-type/device", QEMU_CAPS_SCREENDUMP_DEVICE },
+ { "query-blockstats/ret-type/qdev", QEMU_CAPS_BLOCKDEV },
};
[...]