* [Qemu-devel] unix domain socket communication with guests
@ 2011-06-20 16:24 Joel Uckelman
2011-06-21 8:47 ` Amit Shah
0 siblings, 1 reply; 6+ messages in thread
From: Joel Uckelman @ 2011-06-20 16:24 UTC (permalink / raw)
To: qemu-devel
I'm trying to set up a unix domain socket with a guest on one end and
the host on the other, where the server is running on and bound to the
socket on the guest. I've been able to get the reverse, where the
server is running on the host, this way:
qemu-kvm -kernel kernel -initrd initrd -hda root -device virtio-serial
-serial stdio -chardev
socket,path=/home/uckelman/projects/lightbox/supermin/foo,id=channel0,name=org.libguestfs.channel.0
But, when I try to bind(2) on the guest, I get an "Address already in
use" error. Adding the "server,nowait" options to -chardev doesn't
help---I still get the same error.
What am I doing wrong here?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] unix domain socket communication with guests
2011-06-20 16:24 [Qemu-devel] unix domain socket communication with guests Joel Uckelman
@ 2011-06-21 8:47 ` Amit Shah
2011-06-23 15:37 ` Joel Uckelman
0 siblings, 1 reply; 6+ messages in thread
From: Amit Shah @ 2011-06-21 8:47 UTC (permalink / raw)
To: Joel Uckelman; +Cc: qemu-devel
On (Mon) 20 Jun 2011 [18:24:38], Joel Uckelman wrote:
> I'm trying to set up a unix domain socket with a guest on one end and
> the host on the other, where the server is running on and bound to the
> socket on the guest. I've been able to get the reverse, where the
> server is running on the host, this way:
>
> qemu-kvm -kernel kernel -initrd initrd -hda root -device virtio-serial
> -serial stdio -chardev
> socket,path=/home/uckelman/projects/lightbox/supermin/foo,id=channel0,name=org.libguestfs.channel.0
With this, you have a virtio-serial connection between the host and
the guest. The unix socket exists between a client program and the
qemu invocation on the host, with the qemu end being wired to the host
end of the virtio-serial connection.
You cannot have a unix socket between a host and a guest, they run
different kernels.
Amit
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] unix domain socket communication with guests
2011-06-21 8:47 ` Amit Shah
@ 2011-06-23 15:37 ` Joel Uckelman
2011-06-24 2:54 ` Amit Shah
0 siblings, 1 reply; 6+ messages in thread
From: Joel Uckelman @ 2011-06-23 15:37 UTC (permalink / raw)
To: Amit Shah; +Cc: qemu-devel
On Tue, Jun 21, 2011 at 10:47 AM, Amit Shah <amit.shah@redhat.com> wrote:
> On (Mon) 20 Jun 2011 [18:24:38], Joel Uckelman wrote:
>> I'm trying to set up a unix domain socket with a guest on one end and
>> the host on the other, where the server is running on and bound to the
>> socket on the guest. I've been able to get the reverse, where the
>> server is running on the host, this way:
>>
>> qemu-kvm -kernel kernel -initrd initrd -hda root -device virtio-serial
>> -serial stdio -chardev
>> socket,path=/home/uckelman/projects/lightbox/supermin/foo,id=channel0,name=org.libguestfs.channel.0
>
> With this, you have a virtio-serial connection between the host and
> the guest. The unix socket exists between a client program and the
> qemu invocation on the host, with the qemu end being wired to the host
> end of the virtio-serial connection.
>
> You cannot have a unix socket between a host and a guest, they run
> different kernels.
>
Thanks for the explanation. I was mistaken about how virtio-serial
worked---I thought it looked like a unix socket on both sides, and
there was some cleverness between the ends to make that happen.
I guess this means I need to get networking running on the guest so
that it has a port visible to the host on which my server can listen.
Is there a guide somewhere for doing that? I've not had any success in
an afternoon of searching and trying.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] unix domain socket communication with guests
2011-06-23 15:37 ` Joel Uckelman
@ 2011-06-24 2:54 ` Amit Shah
2011-06-24 10:54 ` Joel Uckelman
0 siblings, 1 reply; 6+ messages in thread
From: Amit Shah @ 2011-06-24 2:54 UTC (permalink / raw)
To: Joel Uckelman; +Cc: qemu-devel
On (Thu) 23 Jun 2011 [17:37:50], Joel Uckelman wrote:
> On Tue, Jun 21, 2011 at 10:47 AM, Amit Shah <amit.shah@redhat.com> wrote:
> > On (Mon) 20 Jun 2011 [18:24:38], Joel Uckelman wrote:
> >> I'm trying to set up a unix domain socket with a guest on one end and
> >> the host on the other, where the server is running on and bound to the
> >> socket on the guest. I've been able to get the reverse, where the
> >> server is running on the host, this way:
> >>
> >> qemu-kvm -kernel kernel -initrd initrd -hda root -device virtio-serial
> >> -serial stdio -chardev
> >> socket,path=/home/uckelman/projects/lightbox/supermin/foo,id=channel0,name=org.libguestfs.channel.0
> >
> > With this, you have a virtio-serial connection between the host and
> > the guest. The unix socket exists between a client program and the
> > qemu invocation on the host, with the qemu end being wired to the host
> > end of the virtio-serial connection.
> >
> > You cannot have a unix socket between a host and a guest, they run
> > different kernels.
> >
>
> Thanks for the explanation. I was mistaken about how virtio-serial
> worked---I thought it looked like a unix socket on both sides, and
> there was some cleverness between the ends to make that happen.
>
> I guess this means I need to get networking running on the guest so
> that it has a port visible to the host on which my server can listen.
> Is there a guide somewhere for doing that? I've not had any success in
> an afternoon of searching and trying.
Can't say I understand what you're trying to accomplish. If you want
to just pass data between a guest and host w/o networking,
virtio-serial is one way of doing it. If you have networking enabled
and the host and guest can talk to each other, TCP or UDP
communication will work as usual.
Amit
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] unix domain socket communication with guests
2011-06-24 2:54 ` Amit Shah
@ 2011-06-24 10:54 ` Joel Uckelman
2011-06-27 9:41 ` Amit Shah
0 siblings, 1 reply; 6+ messages in thread
From: Joel Uckelman @ 2011-06-24 10:54 UTC (permalink / raw)
To: Amit Shah; +Cc: qemu-devel
On Fri, Jun 24, 2011 at 4:54 AM, Amit Shah <amit.shah@redhat.com> wrote:
>>
>> I guess this means I need to get networking running on the guest so
>> that it has a port visible to the host on which my server can listen.
>> Is there a guide somewhere for doing that? I've not had any success in
>> an afternoon of searching and trying.
>
> Can't say I understand what you're trying to accomplish. If you want
> to just pass data between a guest and host w/o networking,
> virtio-serial is one way of doing it. If you have networking enabled
> and the host and guest can talk to each other, TCP or UDP
> communication will work as usual.
>
> Amit
I have a server which I want to run on the guest, and one or more
clients which I want to run on the host. So, I need something I can
bind(2) to on the guest side, and something I can connect(2) to on the
host side. Is that clearer? Is this possible to do with virtio-serial?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] unix domain socket communication with guests
2011-06-24 10:54 ` Joel Uckelman
@ 2011-06-27 9:41 ` Amit Shah
0 siblings, 0 replies; 6+ messages in thread
From: Amit Shah @ 2011-06-27 9:41 UTC (permalink / raw)
To: Joel Uckelman; +Cc: qemu-devel
On (Fri) 24 Jun 2011 [12:54:07], Joel Uckelman wrote:
> On Fri, Jun 24, 2011 at 4:54 AM, Amit Shah <amit.shah@redhat.com> wrote:
> >>
> >> I guess this means I need to get networking running on the guest so
> >> that it has a port visible to the host on which my server can listen.
> >> Is there a guide somewhere for doing that? I've not had any success in
> >> an afternoon of searching and trying.
> >
> > Can't say I understand what you're trying to accomplish. If you want
> > to just pass data between a guest and host w/o networking,
> > virtio-serial is one way of doing it. If you have networking enabled
> > and the host and guest can talk to each other, TCP or UDP
> > communication will work as usual.
> >
> > Amit
>
> I have a server which I want to run on the guest, and one or more
> clients which I want to run on the host. So, I need something I can
> bind(2) to on the guest side, and something I can connect(2) to on the
> host side. Is that clearer? Is this possible to do with virtio-serial?
No, not possible. You could explore using virtio-9pfs with slightly
different semantics.
Amit
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-06-27 9:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-20 16:24 [Qemu-devel] unix domain socket communication with guests Joel Uckelman
2011-06-21 8:47 ` Amit Shah
2011-06-23 15:37 ` Joel Uckelman
2011-06-24 2:54 ` Amit Shah
2011-06-24 10:54 ` Joel Uckelman
2011-06-27 9:41 ` Amit Shah
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).