QMP: Introduce basic asynchronous events
Debug, shutdown, reset, powerdown and stop are all basic events,as they are very simple they can be added in the same commit.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QMP: Output support
In the new Monitor output is always performed by only twofunctions: do_info() and monitor_call_handler().
To support QMP output, we modify those functions to check if weare in control mode. If so, we call monitor_protocol_emitter()...
QMP: do_info() checks
This commit adds specific QMP checks to do_info(), so thatit behaves as expected in QMP mode.
QMP: Input support
The JSON stream parser is used to do QMP input. When thereare enough characters to be parsed it calls Monitor'shandle_qmp_command() function to handle the input.
This function's job is to check if the input is correct andcall the appropriate handler. In other words, it does for QMP...
QMP: Allow 'query-' commands
The 'info' command makes sense for the user protocol, but for QMPit doesn't, as its return data is not well defined. That is, itcan return anything.
To fix this Avi proposes having 'query-' commands when in protocolmode. For example, 'info balloon' would become 'query-balloon'....
QMP: Asynchronous events infrastructure
Asynchronous events are generated with a call tomonitor_protocol_event().
This function builds the right data-type and emit the eventright away. The emitted data is always a JSON object and itsformat is as follows:...
monitor: Introduce monitor_find_command()
This commit moves the loop which searches for the commandentry corresponding to a command name to its own function.
It will be used by QMP code as well.
monitor: Rename monitor_handle_command()
As this series will add a new kind of Monitor command, it's betterto rename monitor_handle_command() to what it really is:handle_user_command().
This will avoid confusion.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>...
monitor: Introduce 'info commands'
List QMP available commands. Only valid in control mode, wherehas to be used as 'query-commands.
QError: Add errors needed by QMP
Only QERR_QMP_BAD_INPUT_OBJECT is QMP specific, the others canbe used in different contexts by other subsystems.
Please, note that QERR_JSON_PARSING signals any parsing errorfrom the json parser. We will need it until the parser gets...
QMP: Initial support
This commit adds initial QMP support in QEMU. It's importantto notice that most QMP code will be part of the Monitor.
Input will be read by monitor_control_read(). Currently itdoes nothing but next patches will add proper input support....
QError: Add QERR_DEVICE_NOT_ACTIVE
New class for device not active errors.
QError: Add QERR_KVM_MISSING_CAP
New class for KVM unavailable features errors.
monitor: do_info_balloon(): Use QError
monitor: Introduce MONITOR_USE_CONTROL flag
This flag will be set when Monitor enters "control mode", inwhich the output will be defined by the QEMU Monitor Protocol.
This also introduces a macro to check if the flag is set.
monitor: Command-line flag to enable control mode
This commit adds a flag called 'control' to the '-monitor'command-line option. This flag enables control mode.
The syntax is:
qemu [...] -monitor control,<device>
Where <device> is a chardev (excluding 'vc', for obvious reasons)....
monitor: Introduce monitor_call_handler()
This commit moves the code which calls Monitor handlers toits own function, as it will be used by QMP code as well.
Introduce QError
QError is a high-level data type which represents an exceptionin QEMU, it stores the following error information:
- class Error class name (eg. "ServiceUnavailable")- description A detailed error description, which can contain...
monitor: QError support
This commit adds QError support in the Monitor.
A QError member is added to the Monitor struct. This new memberstores error information and is also used to check if an errorhas occurred when the called handler returns.
Additionally, a new macro called qemu_error_new() is introduced....
QError: Add QERR_DEVICE_NOT_FOUND
New class for device not found errors.
qdev: Use QError for 'device not found' error
Please, note that we will lose the "Try -device '?' for a list" hint as it's qdev specific.
QString: Introduce qstring_append_chr()
It appends a C char to a QString.
QString: Introduce qstring_append_int()
QString: Introduce qstring_from_substr()
Note that we can now write qstring_from_str() as a wrapper.
utests: Add qstring_append_chr() unit-test
utests: Add qstring_from_substr() unit-test
QJSON: Introduce qobject_from_jsonv()
It accepts a va_list and will be used by QError. Also simplifiesthe code a little, as the other qobject_from_() functions canuse it.
fix I2C slave addressing
With the recent device handling changes the I2C slave addressing codewas broken. With current code, if a slave with the correct address is
not found on the bus the last scanned slave on the bus will beaddressed. This is wrong. Please find attached a patch to fix it....
Fix qdev property type definition for isa serial/parallel devices
Use the correct qdev property type for these devices.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix qemu_free use in scsi-generic.c
scsi-generic.c is using free() instead of qemu_free().Fix it.
Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix free use in xen_backend.c
xen_backend.c is using qemu_free() instead of free().Fix it.
Fix qemu_malloc/qemu_free use in rtl8139.c
rtl8139.c is using malloc()/free() instead of qemu_malloc()/qemu_free().Fix it.
configure: use correct cflags in compiler checks
linux-user build on fedora 11 breaks because fallocateis broken on that system if -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64are specified, which is what QEMU uses.
We do have a configure check to catch this and disable fallocate,...
pci: move apb specific stuff to apb_pci.c
pci code had a TODO to move apb specificpci bridge initialization to apb_pci.Implement this and remove the TODO.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix qemu_free use in acpi.c
acpi.c is using free() instead of qemu_free().Fix it.
Fix qemu_free use in baum.c
baum.c is using free() instead of qemu_free().Fix it.
Fix qemu_free use in nand.c
nand.c is using free() instead of qemu_free().Fix it.
Fix qemu_free use in bt-l2cap.c
bt-l2cap.c is using free() instead of qemu_free().Fix it.
Fix qemu_free use in nseries.c
nseries.c is using free() instead of qemu_free().Fix it.
vga-pci: Fix access to linear framebuffer
Anthony Liguori's patch fixes the problems withvga display in graphical mode and SeaBIOS.
I only adapted some values for vga-pci.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Makefile: Remove unneeded prerequisites
Thanks to f527c57935e22b56952d1ed1af36070b682ecf70(fix parallel build), these prerequisitesare redundant now and can be removed.
Merge commit 'mst/for_anthony' into mst
msix: clear pending bit of an unused vector
PCI spec states:if a masked vector has its Pending bit set, and the associatedunderlying interrupt events are somehow satisfied (usually by softwarethough the exact manner is function-specific), the function must clear...
msix: fix reset value for enable bit
On reset, we currently clear all bits in msix control register exceptenable bit. This is wrong: the spec says we should clear writeablebits: function mask and enable bit.Correct this.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
msix: fix mask bit state after reset
PCI spec states that mask bit must be 1 after reset.Make it so.
virtio: do not reset msix state on soft reset
msix state is managed by OS, not thedriver, so it's wrong to touch iton io from driver.Mark all vectors unused instead.
msix: add helper to unuse all msix entries
will be used by virtio on soft reset
pci: convert goto into scope in bridge_filter
goto into scope is evil. rearrange pci_bridge_filterso that we always go to end of function on error.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Isaku Yamahata <yamahata@valinux.co.jp>
pci: pci bridge related clean up.
- fix bridge prefetchable memory accesser to check 64bit or not.- use pcibus_t consistently instead mixing pcibus_t and uint64_t.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: fix pci_config_get_io_base().
fix typo in pci_config_get_io_base().
pci: remove magic number, 256 in pci.c
This patch replaces magic number, 256, with ARRAY_SIZE().
pci: split up up pci_update mappings
Split bar address math into a separate function.In particular, this gets rid of an ugly forward gotointo scope that we have there.
pci: clean up of pci_update_mappings()
This patch converts r->size == 0 to !r_size.
pci: remove unused constants
This patch removes unused constants committed byfb23162885f7fd8cf7334bed22c25ac32c7d8b9d.
pci: move typedef, PCIHostState, PCIExpressHost to qemu-common.h.
This patch moves two typedefs, PCIHostState and PCIExpressHost toqemu-common.h for consistency as PCIBus and PCIDevice are typedefedin qemu-common.h.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...
pci: remove some unnecessary comment in pci.h
This patch removes some comment which should go into commit login pci.h.
pci: clean up of pci_init_wmask().
This patch replaces for loop by memset in pci_init_wmask().
pci: kill unnecessary included in pci.c
including pci_host.h isn't needed by pci.c.This patch kills it.
pci_host: remove unnecessary & 0xff.
This patch removes unnecessary & 0xff in pci_dev_find_by_addr().
pci: s/pci_find_host_bus/pci_find_root_bus/g
This patch renames pci_find_host_bus() to pci_find_root_bus()as suggested by "Michael S. Tsirkin" <mst@redhat.com>.
pci: remove pci_sub_bus() by open coding.
Because pci_sub_bus() is used only once so eliminate itby open coding as suggested by "Michael S. Tsirkin" <mst@redhat.com>.
pci: shorten pci_host_{conf, data}_register_xxx function a bit.
pci_host_data_register_io_memory and its variants are too long a bit.So shorten them. Now they arepci_host_{conf, data}_register_{mmio, mmio_noswap, ioport}()
pci: rename (pci_/pcie_mmcfg_)addr_to_dev
This patch renames pci_addr_to_dev(), pcie_mmcfg_addr_to_dev()to pci_dev_find_by_addr(), pcie_dev_find_by_mmcfg_addr()as "Michael S. Tsirkin" <mst@redhat.com> suggested.
pci: remove pci_addr_to_config() by open code
This patch removes pci_addr_to_config() and open code itas suggested by Michael S. Tsirkin <mst@redhat.com>.
pci: simplify (pci_/pcie_mmcfg_)data_read()
Remove switch on length: we don't care abouthigh bits for value, so just return all onesif no device. And add one assert().
pci: move pci_data_{read, write}() declaration from pci.h to pci_host.h
Now pci host stuff has been moved from pci.[hc] to pci_host.[hc]so the declaration of pci_data_{read, write}() should be inpci_host.hThis patch moves them from pci.h to pci_host.h for consistency....
pci: fix pci_info_device().
It printed wrong limit value of bridge.This patch fixes it.
pci: pci.h cleanup: move out stuff not in pci.c
pci.h declares some functions which aren'tdefined in pci.h. Clean up moving thingsto appropriate headers, and update all users.
tcg: initial mips support
Based on a patch from Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
tcg: increase TCG_MAX_OP_SIZE to 192
This is needed on a MIPS host and a 64-bit cross-endian target.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips: use physical address in lladdr
Currently the ll/sc instructions use the virtual address in bothuser and system mode. Use the physical address insteead in systemmode.
target-mips: add a function to do virtual -> physical translations
target-mips: split code raising MMU exception in a separate function
target-mips: factorize load/store code in op_helper.c
Fix commit a167ba50851cdac2fa36633587e98c5956cd6b18
Add support for GNU/kFreeBSD
Revert "vga: do not resize the screen on hw_invalidate"
This causes ctrl+alt+u or ctrl+alt+f to not work when windows hasn't beenresized first. Other graphic emulators do resize the screen onhw_invalidate.
This reverts commit 0bd8246bfec1dfb2eb959f52db535572c0260f4c.
Makefile: Fix spelling
Replace defconfing -> defconfig
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
cpu-all.h: fix cpu_get_real_ticks on mips host
Fix cpu_get_real_ticks:- check should be done on __mips and not __mips_isa_rev- linux kernels >= 2.6.25 are emulating the 2 needed rdhwr functions so it's safe to use rdhwr.
This is better than what's currently in but it doesn't mean it works nicely...
tcg: fix tcg_regset_{set,reset}_reg with more than 32 registers
tcg/ppc64,x86_64: fix constraints of op_qemu_st64
This op only takes two arguments, not two.
linux-user: remove hardcoded value of _NSIG in signal.c
In a bunch of places, 64 is used as value of _NSIG but it's wrongat least on MIPS were _NSIG is 128.
Based on a patch from Arnaud Patard <arnaud.patard@rtp-net.org>
Add missing break.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Update SeaBIOS
This includes the following changes:
42bc394 Make sure to reenable ata interrupts even on error. 494dfc6 Move SeaBIOS post/boot stack to avoid conflict with gPXE. 3133e38 Test for broken gcc -combine on FC12.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ARM atomic ops rewrite
Implement ARMv6 atomic ops (ldrex/strex) using the same trick as PPC.
BCD cleanup
Combine multiple BCD implementations.
DS1338 RTC
Implement MAXIM SD1338 RTC+NVRAM.
GPIO I2C rework
Reqrite bitbanging I2C implementation. New code improves stop/startcondition handling, and gives more accurate input line level.
Introduce intermediate abstraction layer for I2C bitbanging thatis not connected via a GPIO port.
ARM RealView I2C
Add ARM Realview I2C host emulation.
Makefile dependencies for device configs
Add makefile dependencies for target specific device configs.These will copy the default config if none exists, obsoleting the oldconfigure time code. If a config already exists but is older than thedefault then print a warning....
target-mips: fix physical address type in MMU functions
[WIN32] Enable -k option on Windows too
There is no reason to have it disabled on this platform.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips: make CP0_LLAddr register CPU dependent
Depending on the CPU, CP0_LLAddr is either read-only or read-write,and the returned value can be shifted by a variable amount of bits.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
target-mips: rename CP0_LLAddr into lladdr
The variable CP0_LLAddr represent the full lladdr, not the actualregister value, which is only part of this value and depends on theCPU.
Allow build of linuxboot.S with old assemblers
In the spirit of ff56954baf9cfab5cbbe18d10b4a09e4a17f39a8, fix thebuild of linuxboot.S with old as(1) (as found in some BSD base systems)by emitting the bytes of the insn it doesn't like instead.
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>...
Avoid segfault on net_tap_init() failure
Check for fd == -1 there.
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tap-bsd: handle ifname on FreeBSD hosts
Handle ifname on FreeBSD hosts; if no ifname is given, always startthe search from tap0. (Simplified/cleaned up version of what has beenin the FreeBSD ports for a long time.)
Fix tap breakage on BSD hosts (no IFF_VNET_HDR)
net/tap-bsd.c was assuming IFF_VNET_HDR was always available, whichI think isn't true on any BSD.
Fix OpenBSD build of qemu-io
GCC 3.3.5 generates warnings for static forward declarations of data, sorearrange code to use static forward declarations of functions instead.
Use <getopt.h> for optind instead of local definition.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
configure: Fix spelling in comment and rework the comment
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...