On Tue, May 13, 2025 at 13:28:58 +0100, Daniel P. Berrangé wrote:
On Tue, May 13, 2025 at 02:25:51PM +0200, Peter Krempa via Devel
wrote:
> From: Peter Krempa <pkrempa(a)redhat.com>
>
> While the queue count itself is not a guest visible property, libvirt
> uses it to calculate the 'vectors' property of the 'virtio-net'
device
> which is ABI.
>
> Since we don't expose control of 'vectors' explicitly, consider
'queues'
> ABI.
>
> Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
> ---
> src/conf/domain_conf.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
Per your off-list suggestion I'll be adding a comment to the formula
in qemuBuildNicDevProps which calculates 'vectors' to state that it's
guest ABI and must not change:
if (net->driver.virtio.queues > 1) {
if (net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
/* ccw provides a one to one relation of fds to queues and
* does not support the vectors option
*/
mq = VIR_TRISTATE_SWITCH_ON;
} else {
/* As advised at
https://www.linux-kvm.org/page/Multiqueue
* we should add vectors=2*N+2 where N is the vhostfdSize
*/
mq = VIR_TRISTATE_SWITCH_ON;
+ /* As 'vectors' is a guest-OS visible property and thus
+ * guest ABI this formula *MUST NOT* change */
vectors = 2 * net->driver.virtio.queues + 2;
}
}