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 writes: 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 hack than doing this in

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

2013-03-22 Thread Anthony Liguori
Hans de Goede writes: > Hi, > > On 03/22/2013 02:50 PM, Anthony Liguori wrote: >> Hans de Goede 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. >> >>> Frontends end inside t

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 writes: Hi, On 03/21/2013 07:18 PM, Anthony Liguori wrote: Alon Levy 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 d

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 Anthony Liguori
Hans de Goede writes: > Hi, > > On 03/21/2013 07:18 PM, Anthony Liguori wrote: >> Alon Levy 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 no

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

2013-03-22 Thread Anthony Liguori
Gerd Hoffmann 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 someo

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 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 por

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 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 ch

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

2013-03-21 Thread Alon Levy
> > Alon Levy writes: > > > > >> Alon Levy 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

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

2013-03-21 Thread Alon Levy
> Alon Levy writes: > > >> Alon Levy 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 f

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

2013-03-21 Thread Anthony Liguori
Alon Levy writes: >> Alon Levy 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

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

2013-03-21 Thread Alon Levy
> Alon Levy 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 i

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

2013-03-21 Thread Anthony Liguori
Alon Levy 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 add_handlers

[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 --- hw/virtio-console.c | 9 + include/char/char.h | 11 +++ qemu-char.c | 9 + 3 files changed, 29 ins