Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-24 Thread Hans de Goede
Hi, On 03/22/2013 06:11 PM, Anthony Liguori wrote: Hans de Goede hdego...@redhat.com writes: snip If the qemu-char.c code did: int qemu_chr_fe_write(...) { if (!s-fe_open) { qemu_chr_fe_open(s); } ... } That would be one thing. It's a hack, but a more reasonable

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-22 Thread Hans de Goede
Hi, On 03/21/2013 07:18 PM, Anthony Liguori wrote: Alon Levy al...@redhat.com writes: Note that the handler is called chr_is_guest_connected and not chr_is_fe_connected, consistent with other members of CharDriverState. Sorry, I don't get it. There isn't a notion of connected for the

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-22 Thread Gerd Hoffmann
Hi, There isn't a notion of connected for the front-ends in the char layer. The closest thing is whether add_handlers() have been called or not. It isn't new. There are qemu_chr_fe_open + qemu_chr_fe_close doing exactly that signaling (whenever someone has opened the virtio-serial port,

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-22 Thread Hans de Goede
Hi, On 03/22/2013 09:25 AM, Gerd Hoffmann wrote: Hi, There isn't a notion of connected for the front-ends in the char layer. The closest thing is whether add_handlers() have been called or not. It isn't new. There are qemu_chr_fe_open + qemu_chr_fe_close doing exactly that signaling

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-22 Thread Anthony Liguori
Gerd Hoffmann kra...@redhat.com writes: Hi, There isn't a notion of connected for the front-ends in the char layer. The closest thing is whether add_handlers() have been called or not. It isn't new. There are qemu_chr_fe_open + qemu_chr_fe_close doing exactly that signaling (whenever

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-22 Thread Anthony Liguori
Hans de Goede hdego...@redhat.com writes: Hi, On 03/21/2013 07:18 PM, Anthony Liguori wrote: Alon Levy al...@redhat.com writes: Note that the handler is called chr_is_guest_connected and not chr_is_fe_connected, consistent with other members of CharDriverState. Sorry, I don't get it.

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-22 Thread Gerd Hoffmann
Hi, Okay, let's use your example here with a standard UART. In the following sequence, I should receive: 1) Starts guest 2) When guest initializes the UART, qemu_chr_fe_open() 3) Reboot guest 4) Receive qemu_chr_fe_close() 5) Boot new guest without a UART driver 6) Nothing is

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-22 Thread Hans de Goede
Hi, On 03/22/2013 02:50 PM, Anthony Liguori wrote: Hans de Goede hdego...@redhat.com writes: Hi, On 03/21/2013 07:18 PM, Anthony Liguori wrote: Alon Levy al...@redhat.com writes: Note that the handler is called chr_is_guest_connected and not chr_is_fe_connected, consistent with other

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-22 Thread Anthony Liguori
Hans de Goede hdego...@redhat.com writes: Hi, On 03/22/2013 02:50 PM, Anthony Liguori wrote: Hans de Goede hdego...@redhat.com writes: We should have never allowed that in the first place and I object strongly to extending the concept without making it make sense for everything else.

[Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-21 Thread Alon Levy
Note that the handler is called chr_is_guest_connected and not chr_is_fe_connected, consistent with other members of CharDriverState. Signed-off-by: Alon Levy al...@redhat.com --- hw/virtio-console.c | 9 + include/char/char.h | 11 +++ qemu-char.c | 9 + 3

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-21 Thread Anthony Liguori
Alon Levy al...@redhat.com writes: Note that the handler is called chr_is_guest_connected and not chr_is_fe_connected, consistent with other members of CharDriverState. Sorry, I don't get it. There isn't a notion of connected for the front-ends in the char layer. The closest thing is whether

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-21 Thread Alon Levy
Alon Levy al...@redhat.com writes: Note that the handler is called chr_is_guest_connected and not chr_is_fe_connected, consistent with other members of CharDriverState. Sorry, I don't get it. There isn't a notion of connected for the front-ends in the char layer. The closest thing

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-21 Thread Anthony Liguori
Alon Levy al...@redhat.com writes: Alon Levy al...@redhat.com writes: Note that the handler is called chr_is_guest_connected and not chr_is_fe_connected, consistent with other members of CharDriverState. Sorry, I don't get it. There isn't a notion of connected for the front-ends in

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-21 Thread Alon Levy
Alon Levy al...@redhat.com writes: Alon Levy al...@redhat.com writes: Note that the handler is called chr_is_guest_connected and not chr_is_fe_connected, consistent with other members of CharDriverState. Sorry, I don't get it. There isn't a notion of connected for the

Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected

2013-03-21 Thread Alon Levy
Alon Levy al...@redhat.com writes: Alon Levy al...@redhat.com writes: Note that the handler is called chr_is_guest_connected and not chr_is_fe_connected, consistent with other members of CharDriverState. Sorry, I don't get it. There isn't a notion of connected