]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: domain: Add helper for generating 'fdset' ids for VM startup
authorPeter Krempa <pkrempa@redhat.com>
Mon, 24 Jan 2022 15:53:27 +0000 (16:53 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 14 Feb 2022 12:13:59 +0000 (13:13 +0100)
commit56d16e614595cb903e8af803c5fca0c458a72856
tree2ac8bcd9fd8f5b7a8f2dac2450f113c8a843fddb
parent9b07991c19099a95c9fd3954a6c53cbe5a60cd1a
qemu: domain: Add helper for generating 'fdset' ids for VM startup

When starting a VM we must assign unique IDs for fdsets we add via
'-add-fd'. For now it was done by using the index of the filedescriptor
passed to the virCommand. That approach is not very flexible, because
you need to have already passed the 'fd' to virCommand before generating
the fdset path, and also won't nicely work with fdsets containing two or
more fds.

This patch introduces a counter into the private data of a qemu domain
so that we can allocate unique ids without relying on virCommand.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_domain.h