[Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-12-14 Thread Gerd Hoffmann
This patch adds chardev_add_file, chardev_add_tty and chardev_remove monitor commands. chardev_add_file and chardev_add_tty expect an id and a path, they create a file/tty chardev. chardev_del just takes an id argument and zaps the chardev specified. Signed-off-by: Gerd Hoffmann

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-12-14 Thread Paolo Bonzini
Il 14/12/2012 10:38, Gerd Hoffmann ha scritto: This patch adds chardev_add_file, chardev_add_tty and chardev_remove monitor commands. chardev_add_file and chardev_add_tty expect an id and a path, they create a file/tty chardev. I'd rather avoid introducing this interface. Using multiple

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-12-14 Thread Eric Blake
On 12/14/2012 05:17 AM, Paolo Bonzini wrote: Il 14/12/2012 10:38, Gerd Hoffmann ha scritto: This patch adds chardev_add_file, chardev_add_tty and chardev_remove monitor commands. chardev_add_file and chardev_add_tty expect an id and a path, they create a file/tty chardev. I'd rather avoid

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-12-14 Thread Gerd Hoffmann
Hi, { 'enum': 'ChardevFileMode', 'data': # pty = console under Windows # serial = tty under POSIX [ 'file', 'pipe', 'parport', 'pty', 'serial' ] } Hmm, why this enum? I'd stay close to -chardev, i.e. specify the type by backend name. { 'enum: 'ChardevFileSource', 'data': [

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-12-14 Thread Paolo Bonzini
Il 14/12/2012 14:18, Gerd Hoffmann ha scritto: Hi, { 'enum': 'ChardevFileMode', 'data': # pty = console under Windows # serial = tty under POSIX [ 'file', 'pipe', 'parport', 'pty', 'serial' ] } Hmm, why this enum? I'd stay close to -chardev, i.e. specify the type by backend

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-12-14 Thread Gerd Hoffmann
Hi, ... are you passing a file descriptor for a pipe, a file or a parallel/serial port? The open function of the file-based backends basically do (1) create file handles and (2) call qemu_chr_open_fd(). So of you already have an fd the differences are gone. Well, almost. tty has an

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-12-14 Thread Gerd Hoffmann
On 12/14/12 14:45, Paolo Bonzini wrote: Il 14/12/2012 14:18, Gerd Hoffmann ha scritto: Hi, { 'enum': 'ChardevFileMode', 'data': # pty = console under Windows # serial = tty under POSIX [ 'file', 'pipe', 'parport', 'pty', 'serial' ] } Hmm, why this enum? I'd stay close to

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-12-14 Thread Paolo Bonzini
Il 14/12/2012 15:19, Gerd Hoffmann ha scritto: Hi, ... are you passing a file descriptor for a pipe, a file or a parallel/serial port? The open function of the file-based backends basically do (1) create file handles and (2) call qemu_chr_open_fd(). Right, and there's the ugliness where

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-10-18 Thread Gerd Hoffmann
On 10/17/12 12:09, Gerd Hoffmann wrote: This patch adds chardev_add and chardev_remove monitor commands. They work similar to the netdev_{add,del} commands. The hmp version of chardev_add accepts like the -chardev command line option does. The qmp version expects the arguments being passed

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-10-18 Thread Paolo Bonzini
Il 18/10/2012 12:03, Gerd Hoffmann ha scritto: Trying another approach, see attached patch. This adds backend-specific qemu commands to add chardevs, with just the parameters needed for the specific backend. Starting with file and tty, both accepting a path. 'file' is nice for testing, 'tty'

[Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-10-17 Thread Gerd Hoffmann
This patch adds chardev_add and chardev_remove monitor commands. They work similar to the netdev_{add,del} commands. The hmp version of chardev_add accepts like the -chardev command line option does. The qmp version expects the arguments being passed as named parameters. chardev_del just takes

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-10-17 Thread Eric Blake
On 10/17/2012 04:09 AM, Gerd Hoffmann wrote: This patch adds chardev_add and chardev_remove monitor commands. They work similar to the netdev_{add,del} commands. The hmp version of chardev_add accepts like the -chardev command line option does. The qmp version expects the arguments being

Re: [Qemu-devel] [PATCH 3/3] chardev: add hotplug support.

2012-10-17 Thread Paolo Bonzini
Il 17/10/2012 17:26, Eric Blake ha scritto: On 10/17/2012 04:09 AM, Gerd Hoffmann wrote: This patch adds chardev_add and chardev_remove monitor commands. They work similar to the netdev_{add,del} commands. The hmp version of chardev_add accepts like the -chardev command line option does.