qemu_fd: Don't rely on fdset id allocation by qemu

If we use our own fdset ID when hot-adding a fdset we can vastly
simplify our internals.

As a stop-gap when a fdset would be added behind libvirt's back we'll
validated that the fdset to be added is not yet used.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa
2022-05-05 16:34:52 +02:00
parent 278c630d2a
commit 1e925d1c17
4 changed files with 30 additions and 50 deletions

View File

@@ -834,6 +834,7 @@ mymain(void)
"device_del", QMP_DEVICE_DELETED("hostdev0") QMP_OK);
DO_TEST_ATTACH("base-live", "interface-vdpa", false, true,
"query-fdsets", "{\"return\":[{\"fdset-id\":99999}]}",
"add-fd", "{ \"return\": { \"fdset-id\": 1, \"fd\": 95 }}",
"netdev_add", QMP_OK, "device_add", QMP_OK);
DO_TEST_DETACH("base-live", "interface-vdpa", false, false,