qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RESEND v6 18/36] multi-process: Initialize Proxy Object's com


From: Stefan Hajnoczi
Subject: Re: [PATCH RESEND v6 18/36] multi-process: Initialize Proxy Object's communication channel
Date: Tue, 12 May 2020 13:35:00 +0100

On Wed, Apr 22, 2020 at 09:13:53PM -0700, address@hidden wrote:
> From: Jagannathan Raman <address@hidden>
> 
> Add "socket" object property which initializes the communication channel
> 
> Signed-off-by: Elena Ufimtseva <address@hidden>
> Signed-off-by: Jagannathan Raman <address@hidden>
> Signed-off-by: John G Johnson <address@hidden>
> ---
>  hw/proxy/qemu-proxy.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/hw/proxy/qemu-proxy.c b/hw/proxy/qemu-proxy.c
> index bf6c4117ef..40bf56fd37 100644
> --- a/hw/proxy/qemu-proxy.c
> +++ b/hw/proxy/qemu-proxy.c
> @@ -14,6 +14,25 @@
>  #include "hw/proxy/qemu-proxy.h"
>  #include "hw/pci/pci.h"
>  
> +static void proxy_set_socket(Object *obj, const char *str, Error **errp)
> +{
> +    PCIProxyDev *pdev = PCI_PROXY_DEV(obj);
> +
> +    pdev->socket = atoi(str);
> +
> +    mpqemu_init_channel(pdev->mpqemu_link, &pdev->mpqemu_link->com,
> +                        pdev->socket);

If mpqemu_link objects are not going to use QOM's object-oriented
features then a plain C struct is fine. There is no need to define a QOM
type for mpqemu_link in an earlier patch.

> +}
> +
> +static void proxy_init(Object *obj)
> +{
> +    PCIProxyDev *pdev = PCI_PROXY_DEV(obj);
> +
> +    pdev->mpqemu_link = mpqemu_link_create();
> +
> +    object_property_add_str(obj, "socket", NULL, proxy_set_socket, NULL);

Please use a qdev property like vhost-vsock.c's vhostfd and call it
either "fd" so it's clear this is the file descriptor.

monitor_fd_param() should be used to parse the fd string at .realize()
time.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]