All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Windows Pipe
@ 2017-03-01 13:15 Jiahuan Zhang
  2017-03-01 14:25 ` Marc-André Lureau
  0 siblings, 1 reply; 7+ messages in thread
From: Jiahuan Zhang @ 2017-03-01 13:15 UTC (permalink / raw)
  To: qemu-devel

Dear QEMU developers,

I want the host-guest communication for QEMU. I want to achieve
it via serial port redirection to a pipe. My host is windows and guest is
Linux. QEMU is in version 2.8.50

I looked into char-pipe.c and char-win.c, and find that the current QEMU
only supports reading data on the pipe from host to guest for Windows.
See *win_chr_pipe_init
() *in char-pipe.c

Is it true?

I don't know how to use *win_chr_write() *in char-win.c.
Can you please present an example?

best regards,
Jiahuan

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

* Re: [Qemu-devel] Windows Pipe
  2017-03-01 13:15 [Qemu-devel] Windows Pipe Jiahuan Zhang
@ 2017-03-01 14:25 ` Marc-André Lureau
  2017-03-01 14:42   ` Jiahuan Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Marc-André Lureau @ 2017-03-01 14:25 UTC (permalink / raw)
  To: Jiahuan Zhang, qemu-devel

Hi

On Wed, Mar 1, 2017 at 5:16 PM Jiahuan Zhang <jiahuanzhang90@gmail.com>
wrote:

> Dear QEMU developers,
>
> I want the host-guest communication for QEMU. I want to achieve
> it via serial port redirection to a pipe. My host is windows and guest is
> Linux. QEMU is in version 2.8.50
>
> I looked into char-pipe.c and char-win.c, and find that the current QEMU
> only supports reading data on the pipe from host to guest for Windows.
> See *win_chr_pipe_init
> () *in char-pipe.c
>
> Is it true?
>

Not exactly, for some reason, the win-chr-pipe uses a poll, win_chr_poll()
that read from the pipe and write to the frontend (the vm serial).  I
haven't tested the windows pipe implementation, only the console one, but
it looks like it should work. Hopefully someone using qemu on windows can
help you.


> I don't know how to use *win_chr_write() *in char-win.c.
> Can you please present an example?
>
> best regards,
> Jiahuan
>
-- 
Marc-André Lureau

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

* Re: [Qemu-devel] Windows Pipe
  2017-03-01 14:25 ` Marc-André Lureau
@ 2017-03-01 14:42   ` Jiahuan Zhang
  2017-03-01 14:58     ` Marc-André Lureau
  0 siblings, 1 reply; 7+ messages in thread
From: Jiahuan Zhang @ 2017-03-01 14:42 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: qemu-devel

Hi,

I agree with you about win_chr_poll(). But what I wonder is how to write
data into the pipe for the host to get. I see "writeFile()" in
"win_chr_write()", but have no idea how to use it. Or I have to write
something for this writing. In this case, I don't know what the right
buffer pointer for WriteFile() is.

Any clue is greatly appreciated!

On 1 March 2017 at 15:25, Marc-André Lureau <marcandre.lureau@gmail.com>
wrote:

> Hi
>
> On Wed, Mar 1, 2017 at 5:16 PM Jiahuan Zhang <jiahuanzhang90@gmail.com>
> wrote:
>
>> Dear QEMU developers,
>>
>> I want the host-guest communication for QEMU. I want to achieve
>> it via serial port redirection to a pipe. My host is windows and guest is
>> Linux. QEMU is in version 2.8.50
>>
>> I looked into char-pipe.c and char-win.c, and find that the current QEMU
>> only supports reading data on the pipe from host to guest for Windows.
>> See *win_chr_pipe_init
>> () *in char-pipe.c
>>
>> Is it true?
>>
>
> Not exactly, for some reason, the win-chr-pipe uses a poll, win_chr_poll()
> that read from the pipe and write to the frontend (the vm serial).  I
> haven't tested the windows pipe implementation, only the console one, but
> it looks like it should work. Hopefully someone using qemu on windows can
> help you.
>
>
>> I don't know how to use *win_chr_write() *in char-win.c.
>> Can you please present an example?
>>
>> best regards,
>> Jiahuan
>>
> --
> Marc-André Lureau
>

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

* Re: [Qemu-devel] Windows Pipe
  2017-03-01 14:42   ` Jiahuan Zhang
@ 2017-03-01 14:58     ` Marc-André Lureau
  2017-03-01 15:12       ` Jiahuan Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Marc-André Lureau @ 2017-03-01 14:58 UTC (permalink / raw)
  To: Jiahuan Zhang; +Cc: qemu-devel

Hi

On Wed, Mar 1, 2017 at 6:42 PM Jiahuan Zhang <jiahuanzhang90@gmail.com>
wrote:

> Hi,
>
> I agree with you about win_chr_poll(). But what I wonder is how to write
> data into the pipe for the host to get. I see "writeFile()" in
> "win_chr_write()", but have no idea how to use it. Or I have to write
> something for this writing. In this case, I don't know what the right
> buffer pointer for WriteFile() is.
>
> Any clue is greatly appreciated!
>
>
According to the documentation, it "creates a single duplex pipe at
\\.pipe\path", you'll have to open and write to it from a different
application. I don't know if there are console applications that can open
pipe you can use, you'll have to do some research or write one!


On 1 March 2017 at 15:25, Marc-André Lureau <marcandre.lureau@gmail.com>
> wrote:
>
> Hi
>
> On Wed, Mar 1, 2017 at 5:16 PM Jiahuan Zhang <jiahuanzhang90@gmail.com>
> wrote:
>
> Dear QEMU developers,
>
> I want the host-guest communication for QEMU. I want to achieve
> it via serial port redirection to a pipe. My host is windows and guest is
> Linux. QEMU is in version 2.8.50
>
> I looked into char-pipe.c and char-win.c, and find that the current QEMU
> only supports reading data on the pipe from host to guest for Windows.
> See *win_chr_pipe_init
> () *in char-pipe.c
>
> Is it true?
>
>
> Not exactly, for some reason, the win-chr-pipe uses a poll, win_chr_poll()
> that read from the pipe and write to the frontend (the vm serial).  I
> haven't tested the windows pipe implementation, only the console one, but
> it looks like it should work. Hopefully someone using qemu on windows can
> help you.
>
>
> I don't know how to use *win_chr_write() *in char-win.c.
> Can you please present an example?
>
> best regards,
> Jiahuan
>
> --
> Marc-André Lureau
>
>
> --
Marc-André Lureau

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

* Re: [Qemu-devel] Windows Pipe
  2017-03-01 14:58     ` Marc-André Lureau
@ 2017-03-01 15:12       ` Jiahuan Zhang
  2017-03-01 15:24         ` Jiahuan Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Jiahuan Zhang @ 2017-03-01 15:12 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: qemu-devel

What I have done is two things.

1. I create a NamedPipeClient.exe to open the pipe and write a string into
it. QEMU indicates the string is recieved from the pipe.

2. I create another NamedPipeClient.exe to open the pipe and read the data
in the pipe. In qemu, I run a test.bin as kernel with versatilepb.
 test.bin assigns a string to UART0, which is redirected to the pipe.
(test.bin has been verified by -serial stdio.) The test result is: pipe is
opened by NamedPipeClient.exe, but nothing on the pipe to read.

the NamedPipeClient.exe is created by visual studio.

On 1 March 2017 at 15:58, Marc-André Lureau <marcandre.lureau@gmail.com>
wrote:

> Hi
>
> On Wed, Mar 1, 2017 at 6:42 PM Jiahuan Zhang <jiahuanzhang90@gmail.com>
> wrote:
>
>> Hi,
>>
>> I agree with you about win_chr_poll(). But what I wonder is how to write
>> data into the pipe for the host to get. I see "writeFile()" in
>> "win_chr_write()", but have no idea how to use it. Or I have to write
>> something for this writing. In this case, I don't know what the right
>> buffer pointer for WriteFile() is.
>>
>> Any clue is greatly appreciated!
>>
>>
> According to the documentation, it "creates a single duplex pipe at
> \\.pipe\path", you'll have to open and write to it from a different
> application. I don't know if there are console applications that can open
> pipe you can use, you'll have to do some research or write one!
>
>
> On 1 March 2017 at 15:25, Marc-André Lureau <marcandre.lureau@gmail.com>
>> wrote:
>>
>> Hi
>>
>> On Wed, Mar 1, 2017 at 5:16 PM Jiahuan Zhang <jiahuanzhang90@gmail.com>
>> wrote:
>>
>> Dear QEMU developers,
>>
>> I want the host-guest communication for QEMU. I want to achieve
>> it via serial port redirection to a pipe. My host is windows and guest is
>> Linux. QEMU is in version 2.8.50
>>
>> I looked into char-pipe.c and char-win.c, and find that the current QEMU
>> only supports reading data on the pipe from host to guest for Windows.
>> See *win_chr_pipe_init
>> () *in char-pipe.c
>>
>> Is it true?
>>
>>
>> Not exactly, for some reason, the win-chr-pipe uses a poll,
>> win_chr_poll() that read from the pipe and write to the frontend (the vm
>> serial).  I haven't tested the windows pipe implementation, only the
>> console one, but it looks like it should work. Hopefully someone using qemu
>> on windows can help you.
>>
>>
>> I don't know how to use *win_chr_write() *in char-win.c.
>> Can you please present an example?
>>
>> best regards,
>> Jiahuan
>>
>> --
>> Marc-André Lureau
>>
>>
>> --
> Marc-André Lureau
>

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

* Re: [Qemu-devel] Windows Pipe
  2017-03-01 15:12       ` Jiahuan Zhang
@ 2017-03-01 15:24         ` Jiahuan Zhang
  2017-03-01 16:48           ` Jiahuan Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Jiahuan Zhang @ 2017-03-01 15:24 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: qemu-devel

I think the reading failure in 2 is because there is no writing to the pipe
from the frontend (serial port).

So i wonder if the windows pipe implementation is complete. I mean dual-way
pipe.

>From the codes, I sense not. If somebody knows please inform me. 🙏 Thanks
a lot!

On 1 March 2017 at 16:12, Jiahuan Zhang <jiahuanzhang90@gmail.com> wrote:

> What I have done is two things.
>
> 1. I create a NamedPipeClient.exe to open the pipe and write a string into
> it. QEMU indicates the string is recieved from the pipe.
>
> 2. I create another NamedPipeClient.exe to open the pipe and read the data
> in the pipe. In qemu, I run a test.bin as kernel with versatilepb.
>  test.bin assigns a string to UART0, which is redirected to the pipe.
> (test.bin has been verified by -serial stdio.) The test result is: pipe is
> opened by NamedPipeClient.exe, but nothing on the pipe to read.
>
> the NamedPipeClient.exe is created by visual studio.
>
> On 1 March 2017 at 15:58, Marc-André Lureau <marcandre.lureau@gmail.com>
> wrote:
>
>> Hi
>>
>> On Wed, Mar 1, 2017 at 6:42 PM Jiahuan Zhang <jiahuanzhang90@gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I agree with you about win_chr_poll(). But what I wonder is how to write
>>> data into the pipe for the host to get. I see "writeFile()" in
>>> "win_chr_write()", but have no idea how to use it. Or I have to write
>>> something for this writing. In this case, I don't know what the right
>>> buffer pointer for WriteFile() is.
>>>
>>> Any clue is greatly appreciated!
>>>
>>>
>> According to the documentation, it "creates a single duplex pipe at
>> \\.pipe\path", you'll have to open and write to it from a different
>> application. I don't know if there are console applications that can open
>> pipe you can use, you'll have to do some research or write one!
>>
>>
>> On 1 March 2017 at 15:25, Marc-André Lureau <marcandre.lureau@gmail.com>
>>> wrote:
>>>
>>> Hi
>>>
>>> On Wed, Mar 1, 2017 at 5:16 PM Jiahuan Zhang <jiahuanzhang90@gmail.com>
>>> wrote:
>>>
>>> Dear QEMU developers,
>>>
>>> I want the host-guest communication for QEMU. I want to achieve
>>> it via serial port redirection to a pipe. My host is windows and guest is
>>> Linux. QEMU is in version 2.8.50
>>>
>>> I looked into char-pipe.c and char-win.c, and find that the current QEMU
>>> only supports reading data on the pipe from host to guest for Windows.
>>> See *win_chr_pipe_init
>>> () *in char-pipe.c
>>>
>>> Is it true?
>>>
>>>
>>> Not exactly, for some reason, the win-chr-pipe uses a poll,
>>> win_chr_poll() that read from the pipe and write to the frontend (the vm
>>> serial).  I haven't tested the windows pipe implementation, only the
>>> console one, but it looks like it should work. Hopefully someone using qemu
>>> on windows can help you.
>>>
>>>
>>> I don't know how to use *win_chr_write() *in char-win.c.
>>> Can you please present an example?
>>>
>>> best regards,
>>> Jiahuan
>>>
>>> --
>>> Marc-André Lureau
>>>
>>>
>>> --
>> Marc-André Lureau
>>
>
>

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

* Re: [Qemu-devel] Windows Pipe
  2017-03-01 15:24         ` Jiahuan Zhang
@ 2017-03-01 16:48           ` Jiahuan Zhang
  0 siblings, 0 replies; 7+ messages in thread
From: Jiahuan Zhang @ 2017-03-01 16:48 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: qemu-devel

I found the problem! The pipe server and client should be both ready, and
then data transfer can start.

The windows pipe implementation is well-done! Sorry for bothering...

On 1 March 2017 at 16:24, Jiahuan Zhang <jiahuanzhang90@gmail.com> wrote:

> I think the reading failure in 2 is because there is no writing to the
> pipe from the frontend (serial port).
>
> So i wonder if the windows pipe implementation is complete. I mean
> dual-way pipe.
>
> From the codes, I sense not. If somebody knows please inform me. 🙏 Thanks
> a lot!
>
> On 1 March 2017 at 16:12, Jiahuan Zhang <jiahuanzhang90@gmail.com> wrote:
>
>> What I have done is two things.
>>
>> 1. I create a NamedPipeClient.exe to open the pipe and write a string
>> into it. QEMU indicates the string is recieved from the pipe.
>>
>> 2. I create another NamedPipeClient.exe to open the pipe and read the
>> data in the pipe. In qemu, I run a test.bin as kernel with versatilepb.
>>  test.bin assigns a string to UART0, which is redirected to the pipe.
>> (test.bin has been verified by -serial stdio.) The test result is: pipe is
>> opened by NamedPipeClient.exe, but nothing on the pipe to read.
>>
>> the NamedPipeClient.exe is created by visual studio.
>>
>> On 1 March 2017 at 15:58, Marc-André Lureau <marcandre.lureau@gmail.com>
>> wrote:
>>
>>> Hi
>>>
>>> On Wed, Mar 1, 2017 at 6:42 PM Jiahuan Zhang <jiahuanzhang90@gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I agree with you about win_chr_poll(). But what I wonder is how to
>>>> write data into the pipe for the host to get. I see "writeFile()" in
>>>> "win_chr_write()", but have no idea how to use it. Or I have to write
>>>> something for this writing. In this case, I don't know what the right
>>>> buffer pointer for WriteFile() is.
>>>>
>>>> Any clue is greatly appreciated!
>>>>
>>>>
>>> According to the documentation, it "creates a single duplex pipe at
>>> \\.pipe\path", you'll have to open and write to it from a different
>>> application. I don't know if there are console applications that can open
>>> pipe you can use, you'll have to do some research or write one!
>>>
>>>
>>> On 1 March 2017 at 15:25, Marc-André Lureau <marcandre.lureau@gmail.com>
>>>> wrote:
>>>>
>>>> Hi
>>>>
>>>> On Wed, Mar 1, 2017 at 5:16 PM Jiahuan Zhang <jiahuanzhang90@gmail.com>
>>>> wrote:
>>>>
>>>> Dear QEMU developers,
>>>>
>>>> I want the host-guest communication for QEMU. I want to achieve
>>>> it via serial port redirection to a pipe. My host is windows and guest
>>>> is
>>>> Linux. QEMU is in version 2.8.50
>>>>
>>>> I looked into char-pipe.c and char-win.c, and find that the current QEMU
>>>> only supports reading data on the pipe from host to guest for Windows.
>>>> See *win_chr_pipe_init
>>>> () *in char-pipe.c
>>>>
>>>> Is it true?
>>>>
>>>>
>>>> Not exactly, for some reason, the win-chr-pipe uses a poll,
>>>> win_chr_poll() that read from the pipe and write to the frontend (the vm
>>>> serial).  I haven't tested the windows pipe implementation, only the
>>>> console one, but it looks like it should work. Hopefully someone using qemu
>>>> on windows can help you.
>>>>
>>>>
>>>> I don't know how to use *win_chr_write() *in char-win.c.
>>>> Can you please present an example?
>>>>
>>>> best regards,
>>>> Jiahuan
>>>>
>>>> --
>>>> Marc-André Lureau
>>>>
>>>>
>>>> --
>>> Marc-André Lureau
>>>
>>
>>
>

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-01 13:15 [Qemu-devel] Windows Pipe Jiahuan Zhang
2017-03-01 14:25 ` Marc-André Lureau
2017-03-01 14:42   ` Jiahuan Zhang
2017-03-01 14:58     ` Marc-André Lureau
2017-03-01 15:12       ` Jiahuan Zhang
2017-03-01 15:24         ` Jiahuan Zhang
2017-03-01 16:48           ` Jiahuan Zhang

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.