History | View | Annotate | Download (96.8 kB)
qemu-char: eliminate busy waiting on can_read returning zero
The character backend refactoring introduced an undesirable busy wait.The busy wait happens if can_read returns zero and there is data availableon the character device's file descriptor. Then, the I/O watch will...
chardev: drop the Memory chardev driver
It's not used anymore since the last commit.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Acked-by: Gerd Hoffmann <kraxel@redhat.com>
qemu-char: Add qemu_chr_fe_claim / _release helper functions
Add qemu_chr_fe_claim / _release helper functions for properly dealing withavail_connections.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364412581-3672-2-git-send-email-hdegoede@redhat.com...
qemu-char: Call fe_claim / fe_release when not using qdev chr properties
chardev-frontends need to explictly check, increase and decrement theavail_connections "property" of the chardev when they are not using aqdev-chardev-property for the chardev.
This fixes things like:...
Merge remote-tracking branch 'luiz/queue/qmp' into staging
oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()
The fcntl(fd, F_SETFL, O_NONBLOCK) flag is not specific to sockets.Rename to qemu_set_nonblock() just like qemu_set_cloexec().
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
chardev: clear O_NONBLOCK on SCM_RIGHTS file descriptors
When we receive a file descriptor over a UNIX domain socket theO_NONBLOCK flag is preserved. Clear the O_NONBLOCK flag and rely onQEMU file descriptor users like migration, SPICE, VNC, block layer, and...
qemu-char: rewrite io_channel_send_all and drop the '_all' suffix
The current code is oddly written and have equally odd semantics.Despite the '_all' suffix, upon EAGAIN the result will be a partialwrite but instead of returning the partial write, we return EAGAIN....
qemu-char: Rename qemu_chr_generic_open to qemu_chr_be_generic_open
To better reflect that it is for handling a backend being opened.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-3-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Add fe_open tracking
Add tracking of the fe_open state to struct CharDriverState.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-4-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Automatically do fe_open / fe_close on qemu_chr_add_handlers
Most frontends can't really determine if the guest actually has the frontendside open. So lets automatically generate fe_open / fe_close as soon as afrontend becomes ready (as signalled by calling qemu_chr_add_handlers) /...
qemu-char: Cleanup: consolidate fe_open/fe_close into fe_set_open
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-6-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Consolidate guest_close/guest_open into a set_fe_open callback
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-7-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Move incrementing of avail_connections to qdev-properties-system
The decrement of avail_connections is done in qdev-properties-system movethe increment there too for proper balancing of the calls.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
qemu-char: add_handlers: Don't re-send the be_open event on unregister
Resending the be_open event only is useful when a frontend is registering, notwhen it is unregistering.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-9-git-send-email-hdegoede@redhat.com...
qemu-char: Rename opened to be_open
Rename the opened variable to be_open to reflect that it contains theopened state of the backend.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Message-id: 1364292483-16564-2-git-send-email-hdegoede@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
char: introduce a blocking version of qemu_chr_fe_write
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
char: Fix return type of qemu_chr_fe_add_watch()
qemu_chr_fe_add_watch() can return negative errors, therefore it mustnot have an unsigned return type. For consistency with otherqemu_chr_fe_* functions, this uses a standard C int instead of glibtypes....
qemu-char.c: fix waiting for telnet connection message
Current colon position in "waiting for telnet connection" message templateproduces messages like:QEMU waiting for connection on: telnet::127.0.0.16666,server
After moving a colon to the right, we will get a correct messages like:...
chardev: add msmouse support to qapi
This patch adds 'msmouse' support to qapi and also switches overthe msmouse chardev initialization to the new qapi code path.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
chardev: add braille support to qapi
This patch adds 'braille' support to qapi and also switches overthe braille chardev initialization to the new qapi code path.
chardev: switch file init to qapi
This patch switches over the 'file' chardev initializationto the new qapi code path.
chardev: add stdio support to qapi
This patch adds 'stdio' support to qapi and also switches over thestdio chardev initialization to the new qapi code path.
chardev: switch serial/tty init to qapi
This patch switches over the serial chardev initializationto the new qapi code path.
chardev: switch parallel init to qapi
This patch switches over the parallel chardev initializationto the new qapi code path.
chardev: switch pty init to qapi
This patch switches over the pty chardev initializationto the new qapi code path.
Bonus: Taking QemuOpts out of the loop allows some nicecleanups along the way.
chardev: add console support to qapi
This patch adds 'console' support to qapi and also switches over theconsole chardev initialization to the new qapi code path.
chardev: add pipe support to qapi
This patch adds 'pipe' support to qapi and also switches over thepipe chardev initialization to the new qapi code path.
chardev: add spice support to qapi
This patch adds 'spicevmc' and 'spiceport' support to qapi and alsoswitches over the spice chardev initialization to the new qapi codepath.
chardev: add vc support to qapi
This patch adds 'vc' support to qapi and also switches over thevc chardev initialization to the new qapi code path.
chardev: add memory (ringbuf) support to qapi
This patch adds 'memory' support to qapi and also switches overthe memory chardev initialization to the new qapi code path.
chardev: add udp support to qapi
This patch adds 'udp' support to qapi.
chardev: add support for qapi-based chardev initialization
This patch add support for a new way to initialize chardev devices.Instead of calling a initialization function with a QemuOpts we willnow create a (qapi) ChardevBackend, optionally call a function to...
chardev: add mux chardev support to qapi
This adds mux chardev support to the qapi and also makes the qapi-basedchardev creation path handle the "mux=on" option correctly.
chardev: switch null init to qapi
This patch switches over the 'null' chardev initializationto the new qapi code path.
Add a TPM Passthrough backend driver implementation
This patch is based of off version 9 of Stefan Berger's patch series "QEMU Trusted Platform Module (TPM) integration" and adds a new backend driver for it.
This patch adds a passthrough backend driver for passing commands sent to the...
qemu-char: fix win32 build
96c6384776d631839a9c8fe02bf135f9ba22586c did not adjustWin32 #ifdeffery properly, breaking build in later commits. Fix.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Tested-by: Igor Mitsyanko <i.mitsyanko@gmail.com>Message-id: 0ba5565b1ed44380c57d4a5fab86e9549f581ebf.1362822910.git.blauwirbel@gmail.com...
qemu-char: move baum registration to baum.c
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 1b24baa1ec3a174d5cad31e079d829904b53077b.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: move msmouse registeration to msmouse.c
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: b47d1153b0d7669743c9a6bb98ce30f4cf7f876b.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: move text console init to console.c
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 17cefde0a8d7807294bab95e93c3328a20d3f2ed.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: add watch support
This allows a front-end to request for a callback when the backendis writable again.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 96f93c0f741064604bbb6389ce962191120af8b7.1362505276.git.amit.shah@redhat.com...
qemu-char: add pty watch
This lets ptys support adding front end watchs.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 23380f37b22d407ba0b9e080f6ea0d66b279f2d2.1362505276.git.amit.shah@redhat.com...
char: add gio watch fn for tcp backends
Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: b50e668c4f4146a654c5d4412440eb9e589f2c02.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: use a glib timeout instead of qemu-timer
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 05a883ce5a98275b976bf0124610599859c2b7da.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: remove use of QEMUTimer in favor of glib idle function
qemu-char is now independent of the QEMU main loop.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 3cda0bbcfb94912df8a767983a52bb71a4a3231d.1362505276.git.amit.shah@redhat.com...
qemu-char: make char drivers dynamically registerable
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 0ff4f5f2b8b7afdb85a0c241403ad73f472f0b81.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: move spice registration to spice-qemu-char.c
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 49a8d12eeb117e5530b2fab02af7681b54f9245c.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: tcp: make use GIOChannel
I didn't bother switching to g_io_channel_read/write because we need to usesendmsg on Unix. No problem though since we're using an unbuffered channel.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>...
qemu-char: convert fd_chr to use a GIOChannel
This uses the newly introduced IOWatchPoll source.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 0cb5d14510ee835a0ebc23676d10a2cce9280da5.1362505276.git.amit.shah@redhat.com...
qemu-char: convert pty to GIOChannel
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 339eebf3c59a450b0354056e9ac4b41f67230831.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: convert UDP to GIOChannel
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Message-id: 775a2bd666a3d1fa008656bf97191b7573c6ffb5.1362505276.git.amit.shah@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: remove dead/confusing logic with nb_stdio_clients
This code is very old dating back to 2007. What is puzzling is thatSTDIO_MAX_CLIENTS was always #define to 1 meaning that all of the code to dealwith more than one client was unreachable.
Just remove the whole mess of it....
char: add IOWatchPoll support
This is a special GSource that supports CharDriverState stylepoll callbacks.
For reviewability and bisectability, this code is #if 0'd out in thispatch to avoid unused warnings since all of the functions are static.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
move socket_set_nodelay to osdep.c
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
console: allow VCs to be overridden by UI
We want to expose VCs using a VteTerminal widget. We need access to provide ourown CharDriverState in order to do this.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1361367806-4599-3-git-send-email-aliguori@us.ibm.com
qapi: Flatten away ChardevPort
Simplifies the schema and the code.
QMP command
{ "execute" : "chardev-add", "arguments" : { "id" : "ser0", "backend" : { "type" : "port", "data" : { "type": "serial",...
error: Strip trailing '\n' from error string arguments (again)
Commit 6daf194d and be62a2eb got rid of a bunch, but they keep comingback. Tracked down with this Coccinelle semantic patch:
r expression err, eno, cls, fmt; position p; @@ (...
r
qmp: Drop wasteful zero-initialization in qmp_memchar_read()
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Fix chardev "memory" not to drop IAC characters
Undocumented misfeature, get rid of it while we can.
qemu-char: Drop undocumented chardev "memory" compatibility syntax
This is a new device, so there's no compatibility to maintain, and itsuse case isn't common enough to justify shorthand syntax.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
qemu-char: General chardev "memory" code cleanup
Inline trivial cirmem_chr_is_empty() into its only caller.
Rename qemu_chr_cirmem_count() to cirmem_count().
Fast ring buffer index wraparound. Without this, there's no point inrestricting size to a power two....
qemu-char: Saner naming of memchar stuff & doc fixes
New device, has never been released, so we can still improve thingswithout worrying about compatibility.
Naming is a mess. The code calls the device driver CirMemCharDriver,the public API calls it "memory", "memchardev", or "memchar", and the...
qemu-char: Support suffixed ringbuf size arguments like "size=64K"
qmp: Plug memory leaks in memchar-write, memchar-read
qmp: Drop superfluous special case "empty" in qmp_memchar_read()
qmp: Fix design bug and read beyond buffer in memchar-write
Command memchar-write takes data and size parameter. Begs thequestion what happens when data doesn't match size.
With format base64, qmp_memchar_write() copies the full data argument,regardless of size argument....
qmp: Clean up design of memchar-read
The data returned has a well-defined size, which makes the sizereturned along with it redundant at best. Drop it.
qmp: Use generic errors in memchar-read, memchar-write
New errors should be generic unless there's a real use case for richerrors.
qmp: Clean up type usage in qmp_memchar_write(), qmp_memchar_read()
Const-correctness, consistently use standard C types instead of mixingthem with GLib types.
qemu-char: Avoid unused variable warning in some configs
Avoid unused variable warnings:qemu-char.c: In function 'qmp_chardev_open_port':qemu-char.c:3132: warning: unused variable 'fd'qemu-char.c:3132: warning: unused variable 'flags'
in configurations with neither HAVE_CHARDEV_TTY nor...
QAPI: Introduce memchar-read QMP command
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qemu-char: Add new char backend CirMemCharDriver
QAPI: Introduce memchar-write QMP command
chardev: add qmp hotplug commands, with null chardev support
Add chardev-add and chardev-remove qmp commands. Hotplugginga null chardev is supported for now, more will be added later.
chardev: add file chardev support to chardev-add (qmp)
Add support for file chardevs. Output file is mandatory,input file is optional.
chardev: add serial chardev support to chardev-add (qmp)
Similar to file, except that no separate in/out files are supportedbecause it's pointless for direct device access. Also the specialtty ioctl hooks (pass through linespeed settings etc) are activated...
chardev: add parallel chardev support to chardev-add (qmp)
Also alias the old parport name to parallel for -chardev.
chardev: add socket chardev support to chardev-add (qmp)
qemu_chr_open_socket is split into two functions. All initializationafter creating the socket file handler is split away into the newqemu_chr_open_socket_fd function.
chr->filename doesn't get filled from QemuOpts any more. Qemu gathers...
chardev: add pty chardev support to chardev-add (qmp)
The ptsname is returned directly, so there is no need touse query-chardev to figure the pty device path.
chardev: add error reporting for qemu_chr_new_from_opts
chardev: fix QemuOpts lifecycle
qemu_chr_new_from_opts handles QemuOpts release now, so callers don'thave to worry. It will either be saved in CharDriverState, thenreleased in qemu_chr_delete, or in the error case released instantly.
chardev: reduce chardev ifdef mess a bit
qemu-option: move standard option definitions out of qemu-config.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pty: unbreak libvirt
Commit 586502189edf9fd0f89a83de96717a2ea826fdb0 breaks libvirt ptysupport because it tried to figure the pts name from stderr output.
Fix this by moving the label to the end of the line, this way thelibvirt parser does still recognise the message. libvirt looks...
disallow -daemonize usage of stdio (curses display, -nographic, -serial stdio etc)
Curses display requires stdin/out to stay on the terminal,so -daemonize makes no sense in this case. Instead ofleaving display uninitialized like is done since 995ee2bf469de6bb,...
qemu-char: Inherit ptys and improve output from -serial pty
Changes since V1: - Avoid crashing since qemu_opts_id() may return null on some systems according to Markus's suggestion.
When controlling a qemu instance from another program, it'shard to know which serial port or monitor device is redirected...
Merge remote-tracking branch 'bonzini/header-dirs' into staging
softmmu: move remaining include files to include/ subdirectories
softmmu: move include files to include/sysemu/
misc: move include files to include/qemu/
monitor: move include files to include/monitor/
ui: move files to ui/ and include/ui/
net: do not include net.h everywhere
spice-qemu-char: add spiceport chardev
Add a new spice chardev to allow arbitrary communication between thehost and the Spice client via the spice server.
Examples:
This allows the Spice client to have a special port for the qemumonitor:
... -chardev spiceport,name=org.qemu.monitor,id=monitorport...
chardev: Use real-time clock for open timer
The vm clock may be stopped, and then we won't get open events anymore.Seen with QMP sessions.
Reported-by: Dietmar Maurer <dietmar@proxmox.com>Tested-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
chardev: Use timer instead of bottom-half to postpone open event
As the block layer may decide to flush bottom-halfs while the machine isstill initializing (e.g. to read geometry data from the disk), ourpostponed open event may be processed before the last frontend...
qemu-sockets: add error propagation to inet_dgram_opts
Before:
$ qemu-system-x86_64 -monitor udp:localhost:631@localhost:631 inet_dgram_opts: bind(ipv4,127.0.0.1,631): OK inet_dgram_opts failed chardev: opening backend "udp" failed
After:...
qemu-char: ask and print error information from qemu-sockets
$ qemu-system-x86_64 -monitor tcp:localhost:6000 (starts despite error)
$ qemu-system-x86_64 -monitor tcp:foo.bar:12345 getaddrinfo(foo.bar,12345): Name or service not known...
qemu-sockets: add nonblocking connect for Unix sockets
This patch mostly mimics what was done to TCP sockets, but simplerbecause there is only one address to try. It also includes a free EINTRbug fix.