All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] For unix domain socket, will only one client could connect to this socket?
@ 2017-07-27 10:37 Sam
  2017-07-27 10:47 ` Daniel P. Berrange
  0 siblings, 1 reply; 4+ messages in thread
From: Sam @ 2017-07-27 10:37 UTC (permalink / raw)
  To: qemu-devel, qemu-discuss

Hi all,

I'm working on qemu-qga, and I want to send qmp command from this unix
socket, but it hanged there(no response), I don't know if it's connect
failed or something?

[root@yf-mos-test-net09 ~]# socat
> /opt/cloud/workspace/servers/f6fdd093-383b-444e-9bcf-dfa81794d465/qga.sock
> readline
> {"execute": "guest-execute", "session": "4768", "arguments": {"commands":
> [{"command": "/bin/sh", "arguments": ["sh", "-c", "ping -c 1
> 172.16.0.1"]}]}}


My question is, for tcp or udp socket, many client could connect to one
server, is unix socket the same? Thank you~

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

* Re: [Qemu-devel] For unix domain socket, will only one client could connect to this socket?
  2017-07-27 10:37 [Qemu-devel] For unix domain socket, will only one client could connect to this socket? Sam
@ 2017-07-27 10:47 ` Daniel P. Berrange
  2017-07-27 11:58   ` Sam
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel P. Berrange @ 2017-07-27 10:47 UTC (permalink / raw)
  To: Sam; +Cc: qemu-devel, qemu-discuss

On Thu, Jul 27, 2017 at 06:37:32PM +0800, Sam wrote:
> Hi all,
> 
> I'm working on qemu-qga, and I want to send qmp command from this unix
> socket, but it hanged there(no response), I don't know if it's connect
> failed or something?
> 
> [root@yf-mos-test-net09 ~]# socat
> > /opt/cloud/workspace/servers/f6fdd093-383b-444e-9bcf-dfa81794d465/qga.sock
> > readline
> > {"execute": "guest-execute", "session": "4768", "arguments": {"commands":
> > [{"command": "/bin/sh", "arguments": ["sh", "-c", "ping -c 1
> > 172.16.0.1"]}]}}

Pointless use of shell there. Just directly run ping

  {"command": "/bin/ping", "arguments": ["-c", "1", "172.16.0.1"]}

> 
> 
> My question is, for tcp or udp socket, many client could connect to one
> server, is unix socket the same? Thank you~

You can only ever have a single client connected, even with tcp/unix
sockets backends.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

* Re: [Qemu-devel] For unix domain socket, will only one client could connect to this socket?
  2017-07-27 10:47 ` Daniel P. Berrange
@ 2017-07-27 11:58   ` Sam
  2017-07-27 13:52     ` Daniel P. Berrange
  0 siblings, 1 reply; 4+ messages in thread
From: Sam @ 2017-07-27 11:58 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: qemu-devel, qemu-discuss

Thank you, I think another process connect this socket, so I hanged here.

2017-07-27 18:47 GMT+08:00 Daniel P. Berrange <berrange@redhat.com>:

> On Thu, Jul 27, 2017 at 06:37:32PM +0800, Sam wrote:
> > Hi all,
> >
> > I'm working on qemu-qga, and I want to send qmp command from this unix
> > socket, but it hanged there(no response), I don't know if it's connect
> > failed or something?
> >
> > [root@yf-mos-test-net09 ~]# socat
> > > /opt/cloud/workspace/servers/f6fdd093-383b-444e-9bcf-
> dfa81794d465/qga.sock
> > > readline
> > > {"execute": "guest-execute", "session": "4768", "arguments":
> {"commands":
> > > [{"command": "/bin/sh", "arguments": ["sh", "-c", "ping -c 1
> > > 172.16.0.1"]}]}}
>
> Pointless use of shell there. Just directly run ping
>
>   {"command": "/bin/ping", "arguments": ["-c", "1", "172.16.0.1"]}
>
> >
> >
> > My question is, for tcp or udp socket, many client could connect to one
> > server, is unix socket the same? Thank you~
>
> You can only ever have a single client connected, even with tcp/unix
> sockets backends.
>
> Regards,
> Daniel
> --
> |: https://berrange.com      -o-    https://www.flickr.com/photos/
> dberrange :|
> |: https://libvirt.org         -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/
> dberrange :|
>

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

* Re: [Qemu-devel] For unix domain socket, will only one client could connect to this socket?
  2017-07-27 11:58   ` Sam
@ 2017-07-27 13:52     ` Daniel P. Berrange
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrange @ 2017-07-27 13:52 UTC (permalink / raw)
  To: Sam; +Cc: qemu-devel, qemu-discuss

On Thu, Jul 27, 2017 at 07:58:06PM +0800, Sam wrote:
> Thank you, I think another process connect this socket, so I hanged here.

Yes, if another process has it open, you would see a hang if you tried
to connect to it, because the kernel will have queued the incoming
connection, but QEMU will not call accept() on it until the first client
has gone.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

end of thread, other threads:[~2017-07-27 13:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-27 10:37 [Qemu-devel] For unix domain socket, will only one client could connect to this socket? Sam
2017-07-27 10:47 ` Daniel P. Berrange
2017-07-27 11:58   ` Sam
2017-07-27 13:52     ` Daniel P. Berrange

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.