summaryrefslogtreecommitdiffstats
path: root/qemu-char.c
Commit message (Collapse)AuthorAgeFilesLines
* Do not ignore error, if open file failed (-serial /dev/tty)Evgeniy Dushistov2010-02-101-0/+3
| | | | | | | | | In case, when qemu is executed with option like -serial /dev/ttyS0, report if there are problems with opening of devices. At now errors are silently ignoring. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: Remove redundant qemu_chr_generic_open() call.Kusanagi Kouichi2010-01-191-1/+0
| | | | | | | | qemu_chr_open_fd() calls qemu_chr_generic_open(), so qemu_chr_open_tty() doesn't need to call it. Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: Convert qemu_chr_info() to QObjectLuiz Capitulino2009-12-121-2/+41
| | | | | | | | | | Each device is represented by a QDict. The returned QObject is a QList of all devices. This commit should not change user output. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* un-static qemu_chr_parse_compat()Gerd Hoffmann2009-12-121-1/+1
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Don't leak file descriptorsKevin Wolf2009-12-031-4/+4
| | | | | | | | We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors that don't need to be passed to children to stop this misbehaviour. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix commit a167ba50851cdac2fa36633587e98c5956cd6b18Aurelien Jarno2009-11-301-0/+1
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Add support for GNU/kFreeBSDAurelien Jarno2009-11-291-8/+11
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* char: rename qemu_chr_reset to qemu_chr_generic_openAmit Shah2009-11-171-11/+11
| | | | | | | | | | This function sends out the OPENED event to backends that have drive the chardevs. The 'reset' is now a historical artifact and we can now just call the function for what it is. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: Remove special init_reset handlingAmit Shah2009-11-171-9/+0
| | | | | | | | | | | | The initial_reset sent to chardevs doesn't do much other than setting a bool to true. Char devices are interested in the open event and that gets sent whenever the device is opened. Moreover, the reset logic breaks as and when qemu's bh scheduling changes. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: don't limit data sent to backends to 1k per bufferAmit Shah2009-11-171-6/+8
| | | | | | | | | | | | | | | | | | chardevs have a 'can_read' function via which backends specify the amount of data they can receive. When can_read returns > 0, apps can start sending data. However, each chardev driver here allows a max. of 1k bytes inspite of the backend being able to receive more. The best we can do here is to allocate s->max_size bytes from the heap on each call (which is the number returned by the backend from the can_read call). This is an intermediate step to bump up the bytes written in each call to 4k. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* serial: Support additional serial speed valuesStefan Weil2009-10-301-26/+61
| | | | | | | | | * Allow any speed value which is defined for Linux (and possibly other systems). * Compare int values instead of double values. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Revert "char: emit the OPENED event only when a new char connection is opened"Anthony Liguori2009-10-271-6/+1
| | | | | | | | This reverts commit 6cfa64de908d67fb6f6b6e3ae4888dd863f69e44. This breaks the monitor prompt. Proper fix will come from Amit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* net: remove unused includes of if_tun.h and if_tap.hMark McLoughlin2009-10-271-6/+0
| | | | | | | Looks like these are just artifacts of vl.c being split up. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add chardev option to disable signal.Kusanagi Kouichi2009-10-271-3/+3
| | | | | | | | | If I am using vga and serial which is stdio and hit C-c on serial console, qemu terminates. That is annoying for me. So make it configurable whether signal is generated when C-c is hit. Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: emit the OPENED event only when a new char connection is openedAmit Shah2009-10-211-1/+6
| | | | | | | | | | The OPENED event gets sent also when qemu resets its state initially. The consumers of the event aren't interested in receiving this event on reset. Patchworks-ID: 35288 Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: rename CHR_EVENT_RESET to CHR_EVENT_OPENEDAmit Shah2009-10-211-1/+1
| | | | | | | | | The char event RESET is emitted when a char device is opened. Give it a better name. Patchworks-ID: 35287 Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: check for initial_reset_issued unnecessaryAmit Shah2009-10-211-4/+1
| | | | | | | | | At init, qemu_chr_reset is always called with initial_reset_issued set to 1. So checking for it to be set is not necessary. Patchworks-ID: 35286 Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix sys-queue.h conflict for goodBlue Swirl2009-09-121-9/+9
| | | | | | | | | | | | | | | Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* move mux focus field from CharDriverState to MuxDriverGerd Hoffmann2009-09-111-13/+14
| | | | | | | | Now that monitor stopped using focus we can make it internal to the mux driver. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: fix muxingGerd Hoffmann2009-09-111-0/+4
| | | | | | | | | | | | make the mux driver send mux_in and mux_out events when switching focus while hooking up more handlers. stop using CharDriverState->focus in monitor.c, track state using the mux events instead. This also removes the implicit assumtion that a muxed monitor allways has mux channel 0. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Allow -serial chardev:<name>Gerd Hoffmann2009-09-111-0/+16
| | | | | | | | | | | | | | | | | | | | | Lets put -chardev into use now. With this patch applied chardev:name is accepted as chardev specification everywhere, i.e. now you can: -chardev stdio,id=ttyS0 -serial chardev:ttyS0 which does the same as '-serial stdio". Muxing can be done this way: -chardev stdio,id=mux,mux=on -serial chardev:mux -monitor chardev:mux You can mux more than two streams. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* convert udp chardev to QemuOpts.Gerd Hoffmann2009-09-111-38/+35
| | | | | | | | | | | | While being at it: create a new inet_dgram_opts() function for udp setup, so udp can handle IPv6 now. new cmd line syntax: -chardev udp,id=name,host=remotehost,port=remoteport,\ localaddr=bindaddr,localport=bindport Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* convert mux chardev to QemuOpts.Gerd Hoffmann2009-09-111-11/+21
| | | | | | | | | | new cmd line syntax: you can add mux=1 to any chardev to enable muxing, then attach it multiple times, like this: -chardev pty,name=mux,mux=on Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* convert vc chardev to QemuOpts.Gerd Hoffmann2009-09-111-7/+19
| | | | | | | | | | new cmd line syntax: -chardev vc,id=name -chardev vc,id=name,width=pixels,height=pixels -chardev vc,id=name,cols=chars,rows=chars Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* convert tty + parport chardevs to QemuOpts.Gerd Hoffmann2009-09-111-25/+32
| | | | | | | | | new cmd line syntax: -chardev tty,id=name,path=/dev/tty* -chardev parport,id=name,path=/dev/parport* Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* convert windows console chardev to QemuOpts.Gerd Hoffmann2009-09-111-4/+6
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* convert braille chardev to QemuOpts.Gerd Hoffmann2009-09-111-5/+4
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* convert msmouse chardev to QemuOpts.Gerd Hoffmann2009-09-111-5/+5
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* convert stdio chardev to QemuOpts.Gerd Hoffmann2009-09-111-5/+4
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* convert pty chardev to QemuOpts.Gerd Hoffmann2009-09-111-6/+7
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* convert unix+tcp chardevs to QemuOpts.Gerd Hoffmann2009-09-111-56/+66
| | | | | | | | | | | | | | new cmd line syntax: unix socket: -chardev socket,id=name,path=/path/to/socket tcp socket: -chardev socket,id=name,host=hostaddr|ipaddr,port=portnr server and nowait options work as usual. Alternatively you can use server=[on|off] + wait=[on|off] syntax. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* convert file+pipe chardevs to QemuOpts.Gerd Hoffmann2009-09-111-15/+32
| | | | | | | | | new cmd line syntax: -chardev file,id=name,path=/path/to/file -chardev pipe,id=name,path=/path/to/pipe Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* switch chardev to QemuOpts: infrastructure, null deviceGerd Hoffmann2009-09-111-4/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | start switching chardevs to QemuOpts. This patch adds the infrastructure and converts the null device. The patch brings two new functions: qemu_chr_open_opts() same as qemu_chr_open(), but uses QemuOpts instead of a option char string. qemu_chr_parse_compat() accepts a traditional chardev option string, returns the corresponding QemuOpts instance, to handle backward compatibility. The patch also adds a new -chardev switch which can be used to create named+unconnected chardevs, like this: -chardev null,id=test This uses the new qemu_chr_open_opts. Thus with this patch alone only the null device works. The other devices will follow ... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* char: Emit 'CLOSED' events on char device closeAmit Shah2009-08-241-0/+10
| | | | | | | | Notify users of the char interface whenever the file / connection is closed. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* More NULL pointer fixesBlue Swirl2009-08-011-2/+2
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Fix typo WIN32 -> _WIN32Anthony Liguori2009-07-271-1/+1
| | | | | | This was spotted by Juan Quintela Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* rename HOST_BSD to CONFIG_BSDJuan Quintela2009-07-271-1/+1
| | | | | Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* kill drives_tableGerd Hoffmann2009-07-271-3/+3
| | | | | | | | | | | | | | First step cleaning up the drives handling. This one does nothing but removing drives_table[], still it became seriously big. drive_get_index() is gone and is replaced by drives_get() which hands out DriveInfo pointers instead of a table index. This needs adaption in *tons* of places all over. The drives are now maintained as linked list. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Add SCM_RIGHTS support to unix socket character devicesMark McLoughlin2009-07-271-1/+54
| | | | | | | | | | | If a file descriptor is passed via a message with SCM_RIGHTS ancillary data on a unix socket, store the file descriptor for use in the chr_read() handler. Close the file descriptor if it was not used. The qemu_chr_get_msgfd() API provides access to the passed descriptor. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Make tcp_chr_read() use recvmsg()Mark McLoughlin2009-07-271-1/+24
| | | | | | | | | Split out tcp_chr_recv() out of tcp_chr_read() and implement it on non-win32 using recvmsg(). This is needed for a subsequent patch which implements SCM_RIGHTS support. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* mux-term: Fix timestamp associationJan Kiszka2009-06-161-3/+9
| | | | | | | | So far a new timestamp was generated *after* a full line had been printed. Fix this. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* mux-term: Localize timestampsJan Kiszka2009-06-161-10/+10
| | | | | | | | As we can have multiple multiplexed terminals, timestamp control and tracking should better take place per MuxDriver. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Win32: Don't remove const attribute in type casts.Stefan Weil2009-06-131-1/+1
| | | | | | | | | Type casts removing the const attribute are bad because they hide the fact that the argument remains const. They also result in a compiler warning (at least with MS-C). Signed-off-by: Stefan Weil <weil@mail.berlios.de>
* Fix mingw32 build warningsBlue Swirl2009-06-131-3/+3
| | | | | | | | Work around buffer and ioctlsocket argument type signedness problems Suppress a prototype which is unused on mingw32 Expand a macro to avoid warnings from some GCC versions Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Refactor how display drivers are selectedAnthony Liguori2009-05-211-3/+3
| | | | | | | | | | | My previous commit, f92f8afebe, broke -vnc (spotted by Glauber Costa). This is because it's necessary to tell when the no special display parameters have been passed and default to SDL or VNC appropriately. This refactors the display selection logic to be less complicated which has the effect of fixing the regression mentioned above. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix OpenSolaris gcc4 warnings: iovec type mismatches, missing 'static'blueswir12009-04-131-3/+3
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7103 c046a42c-6fe2-441c-8c8c-71466251a162
* char: Fix closing of various char devices (Jan Kiszka)aliguori2009-03-281-2/+19
| | | | | | | | | | | | | | This patch fixes several issues around closing char devices. Affected were pty (timer was left behind, even running), udp (no close handling at all) and tcp (missing async IO handler cleanup). The bugs either caused segfaults or stalled the qemu process. So far, hot-unplugging USB serial adapters suffered from this. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6911 c046a42c-6fe2-441c-8c8c-71466251a162
* Rename _BSD to HOST_BSD so that it's more obvious that it's defined by configureblueswir12009-03-081-1/+1
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6775 c046a42c-6fe2-441c-8c8c-71466251a162
* Support for DragonFly BSD (Hasso Tepper)blueswir12009-03-071-5/+9
| | | | git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6746 c046a42c-6fe2-441c-8c8c-71466251a162
* monitor: Introduce MONITOR_USE_READLINE flag (Jan Kiszka)aliguori2009-03-051-1/+1
| | | | | | | | | | | | This allows to create monitor terminals that do not make use of the interactive readline back-end but rather send complete commands. The pass-through monitor interface of the gdbstub will be an example. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6717 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud