summaryrefslogtreecommitdiff
path: root/chardev/char.c
AgeCommit message (Collapse)AuthorFilesLines
2018-03-16Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell1-26/+17
* Record-replay lockstep execution, log dumper and fixes (Alex, Pavel) * SCSI fix to pass maximum transfer size (Daniel Barboza) * chardev fixes and improved iothread support (Daniel Berrangé, Peter) * checkpatch tweak (Eric) * make help tweak (Marc-André) * make more PCI NICs available with -net or -nic (myself) * change default q35 NIC to e1000e (myself) * SCSI support for NDOB bit (myself) * membarrier system call support (myself) * SuperIO refactoring (Philippe) * miscellaneous cleanups and fixes (Thomas) # gpg: Signature made Mon 12 Mar 2018 16:10:52 GMT # gpg: using RSA key BFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: (69 commits) tcg: fix cpu_io_recompile replay: update documentation replay: save vmstate of the asynchronous events replay: don't process async events when warping the clock scripts/replay-dump.py: replay log dumper replay: avoid recursive call of checkpoints replay: check return values of fwrite replay: push replay_mutex_lock up the call tree replay: don't destroy mutex at exit replay: make locking visible outside replay code replay/replay-internal.c: track holding of replay_lock replay/replay.c: bump REPLAY_VERSION again replay: save prior value of the host clock replay: added replay log format description replay: fix save/load vm for non-empty queue replay: fixed replay_enable_events replay: fix processing async events cpu-exec: fix exception_index handling hw/i386/pc: Factor out the superio code hw/alpha/dp264: Use the TYPE_SMC37C669_SUPERIO ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org> # Conflicts: # default-configs/i386-softmmu.mak # default-configs/x86_64-softmmu.mak
2018-03-13char: allow passing pre-opened socket file descriptor at startupDaniel P. Berrange1-0/+3
When starting QEMU management apps will usually setup a monitor socket, and then open it immediately after startup. If not using QEMU's own -daemonize arg, this process can be troublesome to handle correctly. The mgmt app will need to repeatedly call connect() until it succeeds, because it does not know when QEMU has created the listener socket. If can't retry connect() forever though, because an error might have caused QEMU to exit before it even creates the monitor. The obvious way to fix this kind of problem is to just pass in a pre-opened socket file descriptor for the QEMU monitor to listen on. The management app can now immediately call connect() just once. If connect() fails it knows that QEMU has exited with an error. The SocketAddress(Legacy) structs allow for FD passing via the monitor, and now via inherited file descriptors from the process that spawned QEMU. The final missing piece is adding a 'fd' parameter in the socket chardev options. This allows both HMP usage, pass any FD number with SCM_RIGHTS, then running HMP commands: getfd myfd chardev-add socket,fd=myfd Note that numeric FDs cannot be referenced directly in HMP, only named FDs. And also CLI usage, by leak FD 3 from parent by clearing O_CLOEXEC, then spawning QEMU with -chardev socket,fd=3,id=mon -mon chardev=mon,mode=control Note that named FDs cannot be referenced in CLI args, only numeric FDs. We do not wire this up in the legacy chardev syntax, so you cannot use FD passing with '-qmp', you must use the modern '-mon' + '-chardev' pair. When passing pre-opened FDs there is a restriction on use of TLS encryption. It can be used on a server socket chardev, but cannot be used for a client socket chardev. This is because when validating a server's certificate, the client needs to have a hostname available to match against the certificate identity. An illustrative example of usage is: #!/usr/bin/perl use IO::Socket::UNIX; use Fcntl; unlink "/tmp/qmp"; my $srv = IO::Socket::UNIX->new( Type => SOCK_STREAM(), Local => "/tmp/qmp", Listen => 1, ); my $flags = fcntl $srv, F_GETFD, 0; fcntl $srv, F_SETFD, $flags & ~FD_CLOEXEC; my $fd = $srv->fileno(); exec "qemu-system-x86_64", \ "-chardev", "socket,fd=$fd,server,nowait,id=mon", \ "-mon", "chardev=mon,mode=control"; Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2018-03-12chardev: introduce chr_machine_done hookPeter Xu1-26/+17
Introduce ChardevClass.chr_machine_done() hook so that chardevs can run customized procedures after machine init. There was an existing mux user already that did similar thing but used a raw machine done notifier. Generalize it into a framework, and let the mux chardevs provide such a class-specific hook to achieve the same thing. Then we can move the mux related code to the char-mux.c file. Since at it, replace the mux_realized variable with the global machine_init_done varible. This notifier framework will be further leverged by other type of chardevs soon. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180306053320.15401-6-peterx@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-03-02Include less of the generated modular QAPI headersMarkus Armbruster1-2/+1
In my "build everything" tree, a change to the types in qapi-schema.json triggers a recompile of about 4800 out of 5100 objects. The previous commit split up qmp-commands.h, qmp-event.h, qmp-visit.h, qapi-types.h. Each of these headers still includes all its shards. Reduce compile time by including just the shards we actually need. To illustrate the benefits: adding a type to qapi/migration.json now recompiles some 2300 instead of 4800 objects. The next commit will improve it further. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180211093607.27351-24-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> [eblake: rebase to master] Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-02Include qapi/qmp/qerror.h exactly where neededMarkus Armbruster1-0/+1
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180211093607.27351-2-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
2018-02-09Move include qemu/option.h from qemu-common.h to actual usersMarkus Armbruster1-0/+1
qemu-common.h includes qemu/option.h, but most places that include the former don't actually need the latter. Drop the include, and add it to the places that actually need it. While there, drop superfluous includes of both headers, and separate #include from file comment with a blank line. This cleanup makes the number of objects depending on qemu/option.h drop from 4545 (out of 4743) to 284 in my "build everything" tree. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-20-armbru@redhat.com> [Semantic conflict with commit bdd6a90a9e in block/nvme.c resolved]
2018-02-09Include qapi/error.h exactly where neededMarkus Armbruster1-0/+2
This cleanup makes the number of objects depending on qapi/error.h drop from 1910 (out of 4743) to 1612 in my "build everything" tree. While there, separate #include from file comment with a blank line, and drop a useless comment on why qemu/osdep.h is included first. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-5-armbru@redhat.com> [Semantic conflict with commit 34e304e975 resolved, OSX breakage fixed]
2018-01-12chardev: introduce qemu_chr_timeout_add_ms()Peter Xu1-0/+18
It's a replacement of g_timeout_add[_seconds]() for chardevs. Chardevs now can have dedicated gcontext, we should always bind chardev tasks onto those gcontext rather than the default main context. Since there are quite a few of g_timeout_add[_seconds]() callers, a new function qemu_chr_timeout_add_ms() is introduced. One thing to mention is that, terminal3270 is still always running on main gcontext. However let's convert that as well since it's still part of chardev codes and in case one day we'll miss that when we move it out of main gcontext too. Also, convert all the timers from GSource tags into GSource pointers. Gsource tag IDs and g_source_remove()s can only work with default gcontext, while now these GSources can logically be attached to other contexts. So let's use explicit g_source_destroy() plus another g_source_unref() to remove a timer. Note: when in the timer handler, we don't need the g_source_destroy() any more since that'll be done automatically if the timer handler returns false (and that's what all the current handlers do). Yet another note: in pty_chr_rearm_timer() we take special care for ms=1000. This patch merged the two cases into one. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180104141835.17987-4-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-12-21chardev: fix backend events regression with mux chardevMarc-André Lureau1-6/+12
Kirill noticied that on recent versions on QEMU he was not able to trigger SysRq to invoke debug capabilites of Linux Kernel. He tracked it down to qemu_chr_be_event() ignoring CHR_EVENT_BREAK due s->be being NULL. The bug was introduced in 2.8, commit a4afa548fc6d ("char: move front end handlers in CharBackend"). Since the commit, the qemu_chr_be_event() failed to deliver CHR_EVENT_BREAK due to qemu_chr_fe_init() does not set s->be in case of mux. Let's fix this by teaching mux to send an event to the frontend with the focus. Reported-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Fixes: a4afa548fc6d ("char: move front end handlers in CharBackend") Message-Id: <20171103152824.21948-2-marcandre.lureau@redhat.com> Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-09-22chardev: remove context in chr_update_read_handlerPeter Xu1-1/+1
We had a per-chardev cache for context, then we don't need this parameter to be passed in every time when chr_update_read_handler() called. As long as we are calling chr_update_read_handler() using qemu_chr_be_update_read_handlers() we'll be fine. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1505975754-21555-5-git-send-email-peterx@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-09-22chardev: add Chardev.gcontext fieldPeter Xu1-0/+1
It caches the gcontext that is used to poll the chardev IO. Before this patch, we only passed it in via chr_update_read_handlers(). However that may not be enough if the char backend is disconnected and reconnected afterward. There are chardev codes that still assumed the context be NULL (which is the main context). Will fix that up in following up patches. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1505975754-21555-3-git-send-email-peterx@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-09-22chardev: new qemu_chr_be_update_read_handlers()Peter Xu1-0/+10
Add a wrapper for the chr_update_read_handler(). Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <1505975754-21555-2-git-send-email-peterx@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-09-04qapi: Mechanically convert FOO_lookup[...] to FOO_str(...)Markus Armbruster1-2/+2
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-14-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-08-01char: don't exit on hmp 'chardev-add help'Anton Nefedov1-1/+1
qemu_chr_new_from_opts() is used from both vl.c and hmp, and it is quite confusing to see qemu suddenly exit after receiving a help option in hmp. Do exit(0) from vl.c instead. Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Message-Id: <1500977081-120929-1-git-send-email-anton.nefedov@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-07-14hmp: add hmp analogue for qmp-chardev-changeAnton Nefedov1-1/+1
Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <1499342940-56739-11-git-send-email-anton.nefedov@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-07-14char: chardevice hotswapAnton Nefedov1-0/+83
This patch adds a possibility to change a char device without a frontend removal. Ideally, it would have to happen transparently to a frontend, i.e. frontend would continue its regular operation. However, backends are not stateless and are set up by the frontends via qemu_chr_fe_<> functions, and it's not (generally) possible to replay that setup entirely in a backend code, as different chardevs respond to the setup calls differently, so do frontends work differently basing on those setup responses. Moreover, some frontend can generally get and save the backend pointer (qemu_chr_fe_get_driver()), and it will become invalid after backend change. So, a frontend which would like to support chardev hotswap has to register a "backend change" handler, and redo its backend setup there. Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <1499342940-56739-4-git-send-email-anton.nefedov@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-07-14char: move QemuOpts->ChardevBackend translation to a separate funcAnton Nefedov1-30/+51
parse function will be used by the following patch Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com> Message-Id: <1499342940-56739-2-git-send-email-anton.nefedov@virtuozzo.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-06-29Add chardev-send-break monitor commandStefan Fritsch1-0/+12
Sending a break on a serial console can be useful for debugging the guest. But not all chardev backends support sending breaks (only telnet and mux do). The chardev-send-break command allows to send a break even if using other backends. Signed-off-by: Stefan Fritsch <sf@sfritsch.de> Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20170611074817.13621-1-sf@sfritsch.de> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Use 'send a break' in all 3 pieces of text as suggested by eblake
2017-06-08chardev: don't use alias names in parse_compat()Marc-André Lureau1-2/+2
"parport" is considered "old" since commit 88a946d32d, when "parallel" was added. Similarly for "tty" in commit d59044ef74d. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-06-02char: rename functions that are not part of feMarc-André Lureau1-8/+7
There is no clear reason to have those functions associated with frontend. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-06-02char: move CharBackend handling in char-fe unitMarc-André Lureau1-342/+1
Move all the frontend struct and methods to a seperate unit. This avoids accidentally mixing backend and frontend calls, and helps with readabilty. Make qemu_chr_replay() a macro shared by both char and char-fe. Export qemu_chr_write(), and use a macro for qemu_chr_write_all() (nb: yes, CharBackend is for char frontend :) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-06-02char: generalize qemu_chr_write_all()Marc-André Lureau1-42/+28
qemu_chr_fe_write() is similar to qemu_chr_write_all(): the later write all with a chardev backend. Make qemu_chr_write() and qemu_chr_fe_write_buffer() take an 'all' argument. If false, handle 'partial' write the way qemu_chr_fe_write() use to, and call qemu_chr_write() from qemu_chr_fe_write(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-06-02chardev: move headers to include/chardevMarc-André Lureau1-5/+5
So they are all in one place. The following patch will move serial & parallel declarations to the respective headers. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-06-02char: cast ARRAY_SIZE() as signed to silent warning on empty arrayPhilippe Mathieu-Daudé1-2/+2
chardev/char.c: In function 'chardev_name_foreach': chardev/char.c:546:19: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits] for (i = 0; i < ARRAY_SIZE(chardev_alias_table); i++) { ^ Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20170530120919.8874-1-f4bug@amsat.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-05-08Merge remote-tracking branch 'bonzini/tags/for-upstream' into stagingStefan Hajnoczi1-1/+1
A large set of small patches. I have not included yet vhost-user-scsi, but it'll come in the next pull request. * use GDB XML register description for x86 * use _Static_assert in QEMU_BUILD_BUG_ON * add "R:" to MAINTAINERS and get_maintainers * checkpatch improvements * dump threading fixes * first part of vhost-user-scsi support * QemuMutex tracing * vmw_pvscsi and megasas fixes * sgabios module update * use Rev3 (ACPI 2.0) FADT * deprecate -hdachs * improve -accel documentation * hax fix * qemu-char GSource bugfix # gpg: Signature made Fri 05 May 2017 06:10:40 AM EDT # gpg: using RSA key 0xBFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * bonzini/tags/for-upstream: (21 commits) vhost-scsi: create a vhost-scsi-common abstraction libvhost-user: replace vasprintf() to fix build get_maintainer: add subsystem to reviewer output get_maintainer: --r (list reviewer) is on by default get_maintainer: it's '--pattern-depth', not '-pattern-depth' get_maintainer: Teach get_maintainer.pl about the new "R:" tag MAINTAINERS: Add "R:" tag for self-appointed reviewers Fix the -accel parameter and the documentation for 'hax' dump: Acquire BQL around vm_start() in dump thread hax: Fix memory mapping de-duplication logic checkpatch: Disallow glib asserts in main code trace: add qemu mutex lock and unlock trace events vmw_pvscsi: check message ring page count at initialisation sgabios: update for "fix wrong video attrs for int 10h,ah==13h" scsi: avoid an off-by-one error in megasas_mmio_write vl: deprecate the "-hdachs" option use _Static_assert in QEMU_BUILD_BUG_ON target/i386: Add GDB XML register description support char: Fix removing wrong GSource that be found by fd_in_tag hw/i386: Build-time assertion on pc/q35 reset register being identical. ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-05-05Merge remote-tracking branch 'elmarco/tags/chr-tests-pull-request' into stagingStefan Hajnoczi1-82/+66
# gpg: Signature made Thu 04 May 2017 12:42:10 PM BST # gpg: using RSA key 0xDAE8E10975969CE5 # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" # gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" # Primary key fingerprint: 87A9 BD93 3F87 C606 D276 F62D DAE8 E109 7596 9CE5 * elmarco/tags/chr-tests-pull-request: (21 commits) tests: add /char/console test tests: add /char/udp test tests: add /char/socket test tests: add /char/file test tests: add /char/pipe test tests: add alias check in /char/ringbuf char-udp: flush as much buffer as possible char-socket: add 'connected' property char-socket: add 'addr' property char-socket: update local address after listen char-socket: introduce update_disconnected_filename() char: useless NULL check char: remove chardevs list char: remove qemu_chardev_add char: use /chardevs container instead of chardevs list vl: add todo note about root container cleanup char: add a /chardevs container container: don't leak container reference xen: use a better chardev type check mux: simplfy muxes_realize_done ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-05-04char: useless NULL checkMarc-André Lureau1-1/+1
g_strdup(NULL) returns NULL already. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-05-04char: remove chardevs listMarc-André Lureau1-6/+0
The list is now empty, the chardev cleanup is taken care of by the unref of the root container. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-05-04char: remove qemu_chardev_addMarc-André Lureau1-23/+4
qemu_chardev_new() now uses object_new_with_props() with /chardevs parent container. It will fail to insert the object if the same "id" already exists. "chardevs" list usage has been removed in previous commits. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-05-04char: use /chardevs container instead of chardevs listMarc-André Lureau1-30/+36
Use object_resolve_path_component() and object_child_foreach() on /chardevs container instead of iterating over chardevs list. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-05-04char: add a /chardevs containerMarc-André Lureau1-18/+32
Add a /chardevs container object to hold the list of chardevs. (Note: QTAILQ chardevs is going away in the following commits) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-05-04mux: simplfy muxes_realize_doneMarc-André Lureau1-7/+2
mux_chr_event() already send events to all backends, rename it, export it, and use it from muxes_realize_done. This should help abstract away mux implementation. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-05-04char: remove qemu_chr_be_generic_openMarc-André Lureau1-8/+2
The function simply alias and hides the real event function. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-05-04chardev: Basic support for TN3270Jing Liu1-2/+9
This introduces basic support for TN3270, which needs to negotiate three Telnet options during handshake: - End of Record - Binary Transmission - Terminal-Type As a basic implementation, this simply ignores NOP and Interrupt Process(IP) commands. More work should be done for them later. For more details, please refer to RFC 854 and 1576. Signed-off-by: Jing Liu <liujbjl@linux.vnet.ibm.com> Signed-off-by: Yang Chen <bjcyang@linux.vnet.ibm.com> Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com> Acked-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-05-03char: Fix removing wrong GSource that be found by fd_in_tagzhanghailiang1-1/+1
We use fd_in_tag to find a GSource, fd_in_tag is return value of g_source_attach(GSource *source, GMainContext *context), the return value is unique only in the same context, so we may get the same values with different 'context' parameters. It is no problem to find the right fd_in_tag by using g_main_context_find_source_by_id(GMainContext *context, guint source_id) while there is only one default main context. But colo-compare tries to create/use its own context, and if we pass wrong 'context' parameter with right fd_in_tag, we will find a wrong GSource to handle. We tried to fix the related codes in commit b43decb015a6efeb9e3cdbdb80f6547ad7248a4c, but it didn't fix the bug completely, because we still have some codes didn't pass *right* context parameter for remove_fd_in_watch(). Let's fix it by record the GSource directly instead of fd_in_tag. Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <1492564532-91680-1-git-send-email-zhang.zhanghailiang@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-03-06char: remove the right fd been watched in qemu_chr_fe_set_handlers()zhanghailiang1-1/+1
We can call qemu_chr_fe_set_handlers() to add/remove fd been watched in 'context' which can be either default main context or other explicit context. But the original logic is not correct, we didn't remove the right fd because we call g_main_context_find_source_by_id(NULL, tag) which always try to find the Gsource from default context. Fix it by passing the right context to g_main_context_find_source_by_id(). Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2017-02-20Add wctablet deviceAnatoli Huseu11-0/+1
Add QEMU Wacom Penpartner serial tablet emulation. GSoC 2016 project. Signed-off-by: Anatoli Huseu1 <avg.tolik@gmail.com> Various cleanups. Add line speed tracking. Implement ST and SP commands. Adapted to chardev QOMification. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1486391007-10116-1-git-send-email-kraxel@redhat.com
2017-01-31char: headers clean-upMarc-André Lureau1-39/+1
Those could probably be squashed with earlier patches, however I couldn't easily identify them, test them or check if there are still necessary on various platforms. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move parallel chardev in its own fileMarc-André Lureau1-286/+1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move serial chardev to its own fileMarc-André Lureau1-276/+2
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move pty chardev in its own fileMarc-André Lureau1-258/+0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move pipe chardev in its own fileMarc-André Lureau1-166/+0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move console in its own fileMarc-André Lureau1-3/+0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move stdio in its own fileMarc-André Lureau1-120/+0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move file chardev in its own fileMarc-André Lureau1-106/+0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move udp chardev in its own fileMarc-André Lureau1-198/+0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move socket chardev to its own fileMarc-André Lureau1-978/+1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move win-stdio into its own fileMarc-André Lureau1-229/+2
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move win chardev base class in its own fileMarc-André Lureau1-250/+3
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>
2017-01-31char: move fd chardev in its own fileMarc-André Lureau1-145/+2
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Eric Blake <eblake@redhat.com>