All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Questions around SocketChardev member is_unix
@ 2017-03-23 15:57 Markus Armbruster
  2017-03-23 16:20 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Armbruster @ 2017-03-23 15:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Marc-André Lureau

qmp_chardev_open_socket() initializes SocketChardev member is_unix like
this:

    s->is_unix = sock->addr->type == SOCKET_ADDRESS_KIND_UNIX;

Its only use is

    if (s->is_unix) {
        qemu_chr_set_feature(chr, QEMU_CHAR_FEATURE_FD_PASS);
    }

Same function.  Should @is_unix be a local variable instead of a member?

It opens the connection like this:

        qio_channel_socket_connect_async(sioc, s->addr,
                                         qemu_chr_socket_connected,
                                         chr, NULL);

or like this:

            if (qio_channel_socket_listen_sync(sioc, s->addr, errp) < 0) {
                goto error;
            }

Looks like it supports all SocketAddressKind, including
SOCKET_ADDRESS_KIND_FD.

If you use SOCKET_ADDRESS_KIND_FD, QEMU_CHAR_FEATURE_FD_PASS is not
set.  Should it be set?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] Questions around SocketChardev member is_unix
  2017-03-23 15:57 [Qemu-devel] Questions around SocketChardev member is_unix Markus Armbruster
@ 2017-03-23 16:20 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2017-03-23 16:20 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: Marc-André Lureau



On 23/03/2017 16:57, Markus Armbruster wrote:
> qmp_chardev_open_socket() initializes SocketChardev member is_unix like
> this:
> 
>     s->is_unix = sock->addr->type == SOCKET_ADDRESS_KIND_UNIX;
> 
> Its only use is
> 
>     if (s->is_unix) {
>         qemu_chr_set_feature(chr, QEMU_CHAR_FEATURE_FD_PASS);
>     }
> 
> Same function.  Should @is_unix be a local variable instead of a member?

Yes, and same for s->client.is_unix (block/nbd.c) and vd->is_unix
(ui/vnc.c).  It seems to be an artifact of pre-QIOChannel code.

> It opens the connection like this:
> 
>         qio_channel_socket_connect_async(sioc, s->addr,
>                                          qemu_chr_socket_connected,
>                                          chr, NULL);
> 
> or like this:
> 
>             if (qio_channel_socket_listen_sync(sioc, s->addr, errp) < 0) {
>                 goto error;
>             }
> 
> Looks like it supports all SocketAddressKind, including
> SOCKET_ADDRESS_KIND_FD.
> 
> If you use SOCKET_ADDRESS_KIND_FD, QEMU_CHAR_FEATURE_FD_PASS is not
> set.  Should it be set?

Probably it should do getsockname and set it dependent on the address
family in the result.

Paolo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-23 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-23 15:57 [Qemu-devel] Questions around SocketChardev member is_unix Markus Armbruster
2017-03-23 16:20 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.