[PATCH 1/9] qemu: fd: Add a distinct set of APIs for 'direct' fd passing mode
Peter Krempa
pkrempa at redhat.com
Tue May 17 13:10:05 UTC 2022
On Tue, May 17, 2022 at 11:07:18 +0200, Peter Krempa wrote:
> Originally I envisioned a common set of APIs for both FD passing
> approaches but it turns out they are not really compatible enough for it
> to make sense to use one set of APIs.
>
> As of such introduce a distinct set of APIs for the 'direct' mode, which
> will later be used to convert all places that currently use
> 'qemuFDPassNewDirect' and later clean up the existing APIs.
>
> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> ---
> src/qemu/qemu_fd.c | 128 +++++++++++++++++++++++++++++++++++++++++++++
> src/qemu/qemu_fd.h | 22 ++++++++
> 2 files changed, 150 insertions(+)
>
> diff --git a/src/qemu/qemu_fd.c b/src/qemu/qemu_fd.c
> index 4641122d1f..442f92df2f 100644
> --- a/src/qemu/qemu_fd.c
> +++ b/src/qemu/qemu_fd.c
> @@ -324,3 +324,131 @@ qemuFDPassGetPath(qemuFDPass *fdpass)
>
> return fdpass->path;
> }
> +
> +
> +struct _qemuFDPassDirect {
> + int fd;
> + char *path;
> + char *name;
> +
> + bool passed; /* passed to qemu via monitor */
> +};
> +
> +
> +void
> +qemuFDPassDirectFree(qemuFDPassDirect *fdpass)
> +{
> +
> + if (!fdpass)
> + return;
> +
> + VIR_FORCE_CLOSE(fdpass->fd);
> + g_free(fdpass->path);
> + g_free(fdpass);
> +}
Consider the following squashed in:
diff --git a/src/qemu/qemu_fd.c b/src/qemu/qemu_fd.c
index 442f92df2f..baa16fd669 100644
--- a/src/qemu/qemu_fd.c
+++ b/src/qemu/qemu_fd.c
@@ -343,6 +343,7 @@ qemuFDPassDirectFree(qemuFDPassDirect *fdpass)
return;
VIR_FORCE_CLOSE(fdpass->fd);
+ g_free(fdpass->name);
g_free(fdpass->path);
g_free(fdpass);
More information about the libvir-list
mailing list