Age | Commit message (Collapse) | Author |
|
Convert the socket char backend to the new style QAPI framework;
this allows it to return an Error ** to callers who might not
want it to print directly about socket failures.
[The rationale for this patch from the ranchu perspective
is that it means that if our attempt to create the android
console backend chardev fails because the port was in use
we don't get a spurious warning printed to stderr.]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
On startup, start listening on the console and ADB ports automatically,
using the same "start at 5554 and work up until we find a pair of
ports which we can listen on" algorithm as the classic emulator.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
This should be squashed into an earlier patch.
Instead of initializing the backend unconditionally from the
android_pipe init with a hardcoded port, just provide a
function to be called by the board which does the backend
init with a passed in port number, and returns false if it
could not listen on that port.
|
|
The Android adbd daemon running inside Android VMs on the emulator
expect to be able to talk to a backend named "qemud:adb" (for historical
reasons).
The backend will carry out a handshake:
1. Listen for connections from the host adb server on
adb_port = <5555 + (2 * emulator instance id)>.
2. Connect to the local adb server on port 5037 if it's available.
3. Listen for and accept the beginning of the handshake with the adbd
daemon (adbd sends 'accept' over the write).
4. After the adb backend detects a connection on <adb_port>, it sends
back an "ok" string to adbd.
5. The adb backend will not send any more data over the pipe until it
recognizes a 'start' request, which means the adbd is ready to
receive data from the host ADB server.
Once the above process is complete, the adb backend will consume
everything it receives on the socket connected on <adb_port> and send it
over the adb pipe and will consume everything it receives over the adb
pipe and send it on the socket connected on <adb_port>.
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
v2
- re-write to be more GIOChannel like
- unify adb_backend_tcp_state into adb_backend_state
- remove connected, fd and tag fields, just use ->chan and ->listen_chan
- don't manually clear Source, use return during connect sequence
- sprinkling of commentary at the salient points
- added a bunch of asserts to ensure things stay consistent
- try and pass around &adb_state as *bs where possible
- squash all fprintf's into DPRINTF
- link current active chan to adb_pipe->chan
v3
- rm pointless wakeup and debug state
|
|
Add the adb-debug backend (identified by "qemud:adb-debug") which simply
prints all chars send accross the pipe buffers from the guest to stderr.
Reads are handled like the zero pipe.
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
|
|
This brings in the android emulator pipe code from the current aosp-qemu
master branch. It works with and has been tested with the pingpong
pipe device. Currently the device cannot save and restore.
- remove dependency on android utils (ANEW/ASTRDUP/AFREE)
- detach from the goldfish_device bus bits (inc irq raising)
- import a few helper functions (uint64_set_high/low, goldfish_guest_is_64bit)
- disable the VM save/restore code
- use current_cpu for memory translation ops instead of cpu_single_env
- fix debugging prints using portable formats
- common code path for translating vaddr->qemu addr*
- make some debug statments user-visible (unimp and guest errors)
There is a hacking backlink between AndroidPipeState and the PipeDevice
stuff (which should be merged cleanly later) just so we can get back to
->irq when we need to.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
---
v2
- Fix get_qemu_addr_of_guest_buffer() to use cpu_physical_memory_map(),
- remove remaining dead code (#if 0/commented)
- rename remaining Goldfish/goldfish_ to Android/android_
- add a little commentary to the top of the file
- completely remove state save/restore code
- add some FIXME statements where known
v3
- handle failure to get physical page
v4
- special case the "qemud:<name>" as an indication of a channel name.
- reverse ping-pong pipe PIPE_WAKE_WRITE/READ wake-ups
- rm some commented out code
- merge in adding pipe device to ranchu model
|
|
After an FB_SET_BASE write, the guest is waiting for us to complete an
update cycle and notify it (via the FB_INT_BASE_UPDATE_DONE interrupt
status bit). Force the graphics backend to actually do a redraw
immediately; this avoids the guest timing out and producing periodic
"goldfish_fb_pan_display: timeout waiting for base update" warnings
on displays like VNC which make an effort to avoid redraw.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Bug was added by 38ee14f4f33f8836fc0e209ca59c6ae8c6edf380.
vnc_jobs_join call is missing in one code path.
Reported-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1402647923-12300-1-git-send-email-kraxel@redhat.com
|
|
Implement the 'help' command ourselves rather than using the
monitor's usual version, so we can make the output text match the
format of the classic emulator. This might not be necessary but
perhaps external tools are parsing the output to see what commands
are supported.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Indirect all the syntax error messages from the command parser
through a function pointer, so the Android console can override
it to put the KO: prefix on them.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Add support for the redir commands which allow addition, removal
and listing of TCP and UDP port rediroctions.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Implement the Android console by hijacking the stock QEMU
monitor and implementing a different command set.
This commit provides the initial minimal framework and
changes to the core monitor code; it implements only the
two commands 'help' and 'kill'.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Add a chr_del_client method to char backends. This makes sense
mostly for TCP, where it means "close the current connection and
then go back to listening for a new one"; the semantics are
as if the remote end had closed the connection.
This could for completeness be supported for other backends
(eg pipe, fd, tty), but this patch only supports it in TCP.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Make slirp_lookup() a public function so other files can look up the
Slirp stack too. We improve the interface a bit so this is practical:
* use Error arguments to report failures rather than calling
monitor_printf() directly
* return a Slirp* rather than a SlirpStack*, since the latter is a type
local to this source file
* rename to net_slirp_lookup() to match the other public functions
in net/slirp.h
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
The hostfwd_add and hostfwd_remove monitor commands allow the user
to optionally specify a vlan/stack tuple. hostfwd_add honours this,
but hostfwd_remove does not (it looks up the tuple but then ignores
the SlirpState it has looked up and always uses the first stack
in the list anyway). Correct this to honour what the user requested.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
If the user specified a (vlan ID, slirp stack name) tuple in a monitor
hostfwd_add/remove command and we can't find it, give the user an
error message rather than silently doing nothing.
This brings this error case in slirp_lookup() into line with the
other two.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Add the goldfish events device to the ranchu board.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Implement the goldfish 'events' device which provides a variety
of input events including simulated touchscreen and hard buttons.
This is a forward port and revamp of the goldfish/events_device
from the classic Android emulator. Some features from the
classic emulator are not supported:
* multitouch
* full keyboard
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Although the milkymist display device is indeed RGB565, it is
bigendian, so we can't actually borrow its drawfn helpers.
Implement our own instead.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
Add a new machine model for the 64-bit ARM Android emulator.
This is based heavily on the 'virt' machine model, and like
that we also create a device tree to pass to the guest kernel.
The major difference is that this board will have all the
Android-specific devices in it.
We leave space for putting in the goldfish_audio device but do
not actually enable it for now, since audio is not an initial
requirement and has not been tested.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
[Cherry pick of master commit 0b919667302aa.]
The first non-register argument isn't placed at offset 0.
Cc: qemu-stable@nongnu.org
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
|
|
[Cherry pick from master commit e637aa66470.]
Commit 5a007547df76446ab891df93ebc55749716609bf tried to fix a
performance degradation caused by bad handling of small timeouts
in the original implementation of g_poll.
Since that commit, hard disk I/O no longer works.
Instead of rewriting the g_poll implementation, this patch simply copies
the original code (released under LGPL) from latest glib and only modifies
it where needed (see comments in the code). URL of the original code:
https://git.gnome.org/browse/glib/tree/glib/gpoll.c
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1401291744-14314-1-git-send-email-sw@weilnetz.de
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
[Cherry pick of master commit d615efac7c4dc.]
In v8 page tables bit 54 in the PTE is UXN in the EL0/EL1 translation regimes
and XN elsewhere. In v7 the bit is always XN. Since we only emulate EL0/EL1 we
can just treat this bit as UXN whenever we are in v8 mode.
Also correctly extract the upper attributes from the PTE entry, the v8 version
tried to avoid extracting the CONTIG bit and ended up with the upper bits being
off-by-one. Instead behave the same as v7 and extract (but ignore) the CONTIG
bit.
This fixes "Bad mode in Synchronous Abort handler detected, code 0x8400000f"
seen when modprobing modules under Linux.
Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Claudio Fontana <claudio.fontana@huawei.com>
Cc: Rob Herring <robherring2@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
[Cherry pick of master commit d3afacc7269f.]
The code for handling writes to the generic timer control registers
had several bugs:
* ISTATUS (bit 2) is read-only but we forced it to zero on any write
* the check for "was IMASK (bit 1) toggled?" incorrectly used '&' where
it should be '^'
* the handling of IMASK was inverted: we should set the IRQ if
ISTATUS is set and IMASK is clear, not if both are set
The combination of these bugs meant that when running a Linux guest
that uses the generic timers we would fairly quickly end up either
forgetting that the timer output should be asserted, or failing to
set the IRQ when the timer was unmasked. The result is that the guest
never gets any more timer interrupts.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1401803208-1281-1-git-send-email-peter.maydell@linaro.org
Cc: qemu-stable@nongnu.org
|
|
The Windows headers provided by MinGW define MOD_SHIFT. Avoid
it by using SPITZ_MOD_* for our constants here.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
lionhead is an emulator-only platform based on the ARM vexpress board.
The current differences are:
1. replace ARM LCDC and audio devices with virtual goldfish devices
2. remove MMC controller (better handled by virtio)
3. add goldfish battery device (using I/O space reclaimed from MMC)
4. remove "legacy" motherboard layout
|
|
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
Even on the android qemu, there are syntax errors when USE_QEMU_AUDIO_IN
is defined to 0 or left undefined. No point in trying to port something
that doesn't work.
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
The device/object APIs and display APIs have been significantly
refactored. qemu also has a tracing API which can replace the debugging
printfs.
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
It's not clear how this worked or how to port it to the new display API,
so disable it for now
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
FB_GET_FORMAT and associated code poke at a bunch of display internals,
but are never referenced by the kernel. Revisit on top of the new qemu
display API if/when it's needed by the kernel.
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
Signed-off-by: Greg Hackmann <ghackmann@google.com>
|
|
* remotes/qmp-unstable/queue/qmp:
qapi: zero-initialize all QMP command parameters
scripts/qapi.py: Avoid syntax not supported by Python 2.4
doc: add "setup" to list of migration states
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
purge error_is_set()
# gpg: Signature made Wed 21 May 2014 11:43:44 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
* remotes/kraxel/tags/pull-chardev-2:
error: error_is_set() is finally unused; remove
char: Explain qmp_chardev_add()'s unusual error handling
char: Clean up fragile use of error_is_set()
char: Use return values instead of error_is_set(errp)
qemu-socket: Clean up inet_connect_opts()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
audio: two intel-hda fixes.
# gpg: Signature made Wed 21 May 2014 09:49:39 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
* remotes/kraxel/tags/pull-audio-5:
hw/audio/intel-hda: Avoid shift into sign bit
audio/intel-hda: support FIFORDY
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
some s390 patches:
- Enable irqfds on s390 via the new adapter interrupt routing type.
As a prereq, fix the kvm enable_cap helpers for some compilers and
split the s390 flic into kvm and non-kvm parts.
- Enable software and hardware debugging support on s390. This needs a
kernel headers update.
# gpg: Signature made Tue 20 May 2014 12:30:54 BST using RSA key ID C6F02FAF
# gpg: Can't check signature: public key not found
* remotes/cohuck/tags/s390x-20140520:
s390x/kvm: hw debugging support via guest PER facility
s390x/kvm: software breakpoint support
s390x: remove duplicate definitions of DIAG 501
linux-headers: update
s390x/virtio-ccw: wire up irq routing and irqfds
s390x/virtio-ccw: reference-counted indicators
s390x: add I/O adapter registration
s390x: split flic into kvm and non-kvm parts
kvm: Fix enable_cap helpers on older gcc
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
* remotes/bonzini/scsi-next:
megasas: remove buildtime strings
block: iscsi build fix if LIBISCSI_FEATURE_IOVECTOR is not defined
virtio-scsi: Plug memory leak on virtio_scsi_push_event() error path
scsi: Document intentional fall through in scsi_req_length()
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
|
In general QMP command parameter values are specified by consumers of the
QMP/HMP interface, but in the case of optional parameters these values may
be left uninitialized.
It is considered a bug for code to make use of optional parameters that have
not been flagged as being present by the marshalling code (via corresponding
has_<parameter> parameter), however our marshalling code will still pass
these uninitialized values on to the corresponding QMP function (to then
be ignored). Some compilers (clang in particular) consider this unsafe
however, and generate warnings as a result. As reported by Peter Maydell:
This is something clang's -fsanitize=undefined spotted. The
code generated by qapi-commands.py in qmp-marshal.c for
qmp_marshal_* functions where there are some optional
arguments looks like this:
bool has_force = false;
bool force;
mi = qmp_input_visitor_new_strict(QOBJECT(args));
v = qmp_input_get_visitor(mi);
visit_type_str(v, &device, "device", errp);
visit_start_optional(v, &has_force, "force", errp);
if (has_force) {
visit_type_bool(v, &force, "force", errp);
}
visit_end_optional(v, errp);
qmp_input_visitor_cleanup(mi);
if (error_is_set(errp)) {
goto out;
}
qmp_eject(device, has_force, force, errp);
In the case where has_force is false, we never initialize
force, but then we use it by passing it to qmp_eject.
I imagine we don't then actually use the value, but clang
complains in particular for 'bool' variables because the value
that ends up being loaded from memory for 'force' is not either
0 or 1 (being uninitialized stack contents).
Fix this by initializing all QMP command parameters to {0} in the
marshalling code prior to passing them on to the QMP functions.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
|
|
The Python "except Foo as x" syntax was only introduced in
Python 2.6, but we aim to support Python 2.4 and later.
Use the old-style "except Foo, x" syntax instead, thus
fixing configure/compile on systems with older Python.
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
|
|
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Character backend open hasn't been fully converted to the Error API.
Some opens fail without setting an error. qmp_chardev_add() needs to
detect when that happens, and set a generic error. Explain that in a
comment, and inline error_is_set() for clarity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Using error_is_set(ERRP) to find out whether a function failed is
either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP
may be null, because errors go undetected when it is. It's fragile
when proving ERRP non-null involves a non-local argument. Else, it's
unnecessarily opaque (see commit 84d18f0).
The error_is_set(errp) in qemu_chr_new_from_opts() is merely fragile,
because the callers never pass a null errp argument.
Make the code more robust and more obviously correct: receive the
error in a local variable, then propagate it through the parameter.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Using error_is_set(errp) to check whether a function call failed is
fragile: it breaks when errp is null. Check perfectly suitable return
values instead when possible. As far as I can tell, errp can't be
null there, but this is more robust and more obviously correct
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Separate the search for a working addrinfo from the code that does
something with it. Makes for a clearer search loop.
Use a local Error * to simplify resetting the error in the search
loop.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
On a slow VM (e.g., nested), you see the "setup" state when you query the
migration status.
Signed-off-by: Peter Feiner <peter@gridcentric.ca>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
|
|
Using __DATE__ or __TIME__ in binary pkgs changes the checksum of
compiled binaries if they get rebuilt, even if there are no other
source changes. Replace the dynamic strings with some equally
informative static strings.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|