Remove unneeded type casts
cpu_physical_memory_read, cpu_physical_memory_write take any pointeras 2nd argument without needing a type cast.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
virtio.h: drop unused function prototypes
They are unused since commit 5c7d0962f60498c3f11d402e1c857cb9d5d8568d.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
bswap: fix compiler warning
The bswap functions use memcpy but the bswap.h header itself does not seem toinclude it in some configuration such as cross compiling for powerpc64on x86_64 machine.
The patch explicitly includes string.h.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>...
configure: QEMU_INCLUDES are the same for all subtargets
Reviewed-by: Peter Maydell <peter.maydell@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
elfload: fix size of ABI-dependent fields in core dumps
Some fields in core dumps are 32-bit in 32-or-64 environments (ppc64abi32,sparc32plus). Use abi_long/ulong for those.
Also, the fields of target_elf_siginfo are ints. Use tswap32 to convert them....
elfload: fix size of registers for N32
Registers are 64-bit in size for the MIPS n32 ABI. Definetarget_elf_greg_t accordingly, and use the correct functionto do endian swaps.
Reviewed-by: Peter Maydell <peter.maydell@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
elfload: use tswapreg consistently in elf_core_copy_regs
elfload: use abi_short/ushort instead of target_short/ushort
The alignment is a characteristic of the ABI, not the CPU.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
elfload: use abi_int/uint instead of target_int/uint
elfload: only give abi_long/ulong the alignment specified by the target
Previously, this was done for target_long/ulong, and propagated toabi_long/ulong via a typedef. But target_long/ulong should nothave any specific alignment, it is never used to access guest...
elfload: use abi_llong/ullong instead of target_llong/ullong
configure: move CONFIG_QEMU_LDST_OPTIMIZATION to config-host.mak
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
configure: move common libraries to config-host.mak
Move -lm to the end of the line, so that it can be picked up as adependency by pixman in the static build case.
configure: eliminate target_libs_softmmu
configure: CONFIG_NO_XEN is duplicated
We already define it in Makefile.target. But we need to avoid acurious double negation in order to eliminate it.
Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
configure: remove duplicate test
We already had a test to add -march=i486 when needed. Make theexisting test independent of vhost-net, so that it is also usedunder Win32.
configure: Put cross compile flags in EXTRA_CFLAGS
The cross compile CFLAGS are needed to properly build pixman (and any othersubmodules). Only the EXTRA_CFLAGS set is passed to submodules not QEMU_CFLAGS,so put the cross compile flags in EXTRA_CFLAGS instead....
dtc: add submodule
Add dtc submodule as a fallback for old distros.Picking version 1.3.0. as this is the most recently tagged stable version.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
configure/Make: Build libfdt from submodule DTC
Configure to use the DTC submodule to build libfdt when no system libfdtis found. Prompt to install the DTC submodule if --enable-fdt is set butno DTC can be found.
DTC has no out-of-tree build capability, so the configure will symlink...
virtio-net-s390: switch to the new API.
Here the virtio-net-s390 is modified for the new API. The devicevirtio-net-s390 extends virtio-s390-device as before. It creates andconnects a virtio-net-device during the init. The properties are not modified.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>...
virtio-net-ccw: switch to the new API.
Here the virtio-net-ccw is modified for the new API. The devicevirtio-net-ccw extends virtio-ccw-device as before. It creates andconnects a virtio-net-device during the init. The properties are not modified.
virtio-net: cleanup: use QOM cast.
As the virtio-net-pci and virtio-net-s390 are switched to the new API,we can use QOM casts.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>Message-id: 1365690602-22729-7-git-send-email-fred.konrad@greensocs.com...
virtio-net: cleanup: init and exit function.
This remove old init and exit function as they are no longer needed.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>Message-id: 1365690602-22729-8-git-send-email-fred.konrad@greensocs.com...
virtio-net-pci: switch to the new API.
Here the virtio-net-pci is modified for the new API. The devicevirtio-net-pci extends virtio-pci. It creates and connects avirtio-net-device during the init. The properties are not changed.
virtio: add two functions to VirtioDeviceClass.
Recent changes need two functions to VirtioDevice. This just add theminto VirtioDeviceClass.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>Message-id: 1365690602-22729-2-git-send-email-fred.konrad@greensocs.com...
virtio-net: add the virtio-net device.
Create virtio-net-device which extends virtio-device, so it can be connected onvirtio-bus.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>Message-id: 1365690602-22729-3-git-send-email-fred.konrad@greensocs.com...
Fix warnings suppressors to honor --disable-werror
Replace
#pragma GCC diagnostic ignored FOO [Troublesome code...] #pragma GCC diagnostic error FOO
by
#pragma GCC diagnostic push #pragma GCC diagnostic ignored FOO [Troublesome code...]...
i440fx-test: add test for PAM functionality
This tests PAM settings for the i440fx. This test does a lot ofbyte MMIO which is fairly slow with qtest today. But the testdoes complete in under 2 seconds.
We don't fully emulate PAM largely because of limitations with...
fw_cfg: add qtest test case
This validates some basic characteristics of fw_cfg.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1366123521-4330-8-git-send-email-aliguori@us.ibm.com
i440fx-test: add test to compare default register values
This test compares all of the default register values against thespec. It turns out we deviate in quite a few places. Theseplaces are really only visible to the BIOS though which is whythis hasn't created any problems....
qtest: add libqos including PCI support
This includes basic PCI support for the PC platform. Enoughabstraction should be present to support non-PC platforms too.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1366123521-4330-3-git-send-email-aliguori@us.ibm.com
libqos: add fw_cfg support
fw_cfg is needed to get the top of memory which is necessary fordoing PCI allocation and allocating RAM for DMA.
Add a PC version of fw_cfg and enough abstraction to support otherplatforms.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
libqos: add malloc support
This is a very simple allocator for the PC platform. It shouldbe possible to add backends for other platforms.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1366123521-4330-5-git-send-email-aliguori@us.ibm.com
qtest: don't use system command to avoid double fork
Currently we waitpid on the child process we spawn off that doesnothing more than system() another process. While this does notappear to be incorrect, it's wasteful and confusing so get rid ofit.
migration: reflect incoming failure to shell
Management apps like libvirt don't know to pay attention tostderr unless there is a non-zero exit status.
Signed-off-by: Eric Blake <eblake@redhat.com>...
qbus: remove wrong error messages
The existing code shows the "Bus '%s' is full" message even if nameis specified and different from bus->name (i.e. match=0).
The patch excludes unnecessary error message.
chardev: remove the headers of Memory chardev driver
Memory chardev driver is no longer used, and Commit:4bf0bb8014ac2ac61b1004f5d92b2a4594d48017 has dropedit but the headers, so clean it up.
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>Message-id: 1366188414-24214-1-git-send-email-lilei@linux.vnet.ibm.com...
Merge remote-tracking branch 'bonzini/migration-writev' into staging
qemu-file: do not use stdio for qemu_fdopen
This uses system calls directly for Unix file descriptors, so that theefficient writev_buffer can be used. Pay attention to the possibilityof partial writes in writev.
Reviewed-by: Juan Quintela <quintela@redhat.com>...
iov: reorganize iov_send_recv, part 3
"si" and "ei" are merged in a single variable.
Reviewed-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Orit Wassermann <owasserm@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
iov: handle partial writes from sendmsg and recvmsg
Partial writes can still happen in sendmsg and recvmsg, if asignal is received in the middle of a write. To handle this,retry the operation with a new offset/bytes pair.
qemu-file: drop socket_put_buffer
It is enough to implement one of socket_writev_buffer andsocket_put_buffer.
iov: reorganize iov_send_recv, part 1
Once the initial part of the iov is dropped, it is not used anymore.Modify iov/iovcnt directly instead of adjusting them with the "si" variable.
Reviewed-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Orit Wassermann <owasserm@redhat.com>...
iov: reorganize iov_send_recv, part 2
Do not touch the "bytes" argument anymore. Instead, remember theoriginal length of the last iovec if we touch it, and restore itafterwards.
This requires undoing the changes in opposite order. The previousalgorithm didn't care....
rng random backend: check for -EAGAIN errors on read
Not handling EAGAIN triggers the assert
qemu/backends/rng-random.c:44:entropy_available: assertion failed: (len != -1)Aborted (core dumped)
This happens when starting a guest with '-device virtio-rng-pci',...
qdev: Fix device_add bus assumptions
Drop an unreachable fallback bus assignment to SysBus.
If no ,bus= is specified, only search busses recursively for bus type ifthe DeviceClass has a bus_type specified. Handle resulting NULL cases.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
qom: do nothing on unparent of object without parent
Otherwise, device_unparent will fail to get a canonical path ofthe object.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1364910600-3418-1-git-send-email-pbonzini@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
migration: initialize RAM to zero
Using qemu_memalign only leaves the RAM zero by chance, because libcwill usually use mmap to satisfy our huge requests. But memory willnot be zero when using MALLOC_PERTURB_ with a nonzero value. In thecase of incoming migration, this breaks a recently-introduced...
Merge remote-tracking branch 'kraxel/usb.80' into staging
Merge remote-tracking branch 'spice/spice.v69' into staging
Merge remote-tracking branch 'kraxel/pixman.v11' into staging
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
xhci: use slotid as device address
Is good enougth for unique device addresses and avoids the need for anystate for device addressing. Makes live migration support easier. Alsomakes device->slot lookups trivial.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
xhci: fix address device
Zero-initialize the set-address dummy USBPacket,also add buffer to avoid sanity checks triggering.
https://bugzilla.redhat.com/show_bug.cgi?id=929019
use libusb for usb-host
Reimplement usb-host on top of libusb.Reasons to do this:
(1) Largely rewritten from scratch, nice opportunity to kill historical cruft. (2) Offload usbfs handling to libusb. (3) Have a single portable code base instead of bsd + linux variants....
usb-serial: Remove double call to qemu_chr_add_handlers( NULL )
usb-serial has a qdev chardev property, and hw/qdev-properties-system.calready contains:
static void release_chr(Object *obj, const char *name, void *opaque) { DeviceState *dev = DEVICE;...
xhci: remove leftover debug printf
xhci: add xhci_cap_write
xhci: fix portsc writes
Check for port reset first and skip everything else then.Add sanity checks for PLS updates.Add PLC notification when entering PLS_U0 state.
This gets host-initiated port resume going on win8.
spice: (32 bit only) fix surface cmd tracking destruction
No change for 64 bit arches, but for 32 bit previously we zeroed halfthe surfaces cmd array, instead of all of it.
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
virtio-console: Also throttle when less was written then requested
This is necessary so that we get properly woken up to write the rest.
This patch also changes the len argument to the have_data callback, toavoid doing an unsigned signed comparison.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
virtio-console: Remove any pending watches on close
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
spice-qemu-char: Remove #ifdef-ed code for old spice-server compat
We now require spice-server to be >= 0.12.0 so this is no longer needed.
spice-qemu-char: Add watch support
spice-qemu-char: Remove intermediate buffer
virtio-serial's buffer is valid when it calls us, and we don'taccess it otherwise: vmc_read is only called in response to wakeup,or else we set datalen=0 and throttle. Then vmc_read is called back,we return 0 (not accessing the buffer) and set the timer to unthrottle....
spice-qemu-char: vmc_write: Don't write more bytes then we're asked too
This one took me eons to debug, but I've finally found it now, oh well.
The usage of the MIN macro in this line: last_out = MIN);
Causes qemu_chr_be_can_write to be called twice, since the MIN macro...
qxl: add 2000x2000 and 2048x2048 video modes
m25p80: Fix debug messages.
Some dodgy casts were making a mess of these msgs.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
m25p80: Convert guest errors to LOG_GUEST_ERROR
Some of the debug printfs in m25p80 are really guest errors.Changed over to qemu_log_mask(LOG_GUEST_ERROR accordingly.
m25p80.c: Multiple debug verbosity levels
The debug printfs on every page program/read is extremely verbose. Adda second level of debug for this.
m25p80: Add debug message for no bdrv
If there is no backing bdrv, let the debugging developer know about it.
xilinx_axidma: Fix rx/tx halted bit.
If there is no DMA buffer descriptor, the DMA halts, not idles.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
stream: Add flow control API
Add basic flow control to stream. A stream slave may return short, indicatingthat it is not capable of accepting any more data at the present time. Pollingor a callback can be used via the can_push() function to determine when the...
xilinx_axienet/dma: Implement rx path flow control
Implement flow control for the RX data path from xilinx_axienet->xilinx_axidma.On short return from axidma, then ethernet sets up the notify callback to resumetransfer from where it left off.
This also allows the ethernet to track whether there is an in progress transaction...
stream: Remove app argument hack
The uint32_t *app argument doesn't exist in real hardware. It was a hack inxilinx_axidma/enet to fake the (secondary) control stream connection. Removedthe argument and added the second stream to axienet/dma.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
xilinx_axienet: typedef XilinxAXIEnet struct
Typedef xilinx_axienets object state struct to shorten the repeated usages ofstruct XilinxAXIEnet.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Andreas Färber <afaerber@suse.de>...
xilinx_axienet: Defined and use type cast macro
Standard QOM cast macro. Replaces usages of FROM_SYSBUS
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>...
xilinx_axienet: Register reset properly
Register the reset function and the Device::reset function rather thanexplicitly call it from the sysbus::init.
xilinx_axienet: converted init->realize
The prescribed transition from SysBusDevice::init to Device::realize. Im goingwith Andreas suggestion to move the sysbus foo to Object::init for early IRQvisibility.
xilinx_axidma: typedef XilinxAXIDMA struct
Typedef xilinx_axidma's object state struct to shorten the repeated usages ofstruct XilinxAXIDMA.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>...
xilinx_axidma: Defined and use type cast macro
xilinx_axidma: Register reset properly
Register the reset function as the Device::reset function rather thanexplicitly call it from the sysbus::init.
xilinx_axidma: converted init->realize
The prescribed transition from SysBusDevice::init to Device::realize. I'm goingwith Andreas suggestion to move the sysbus foo to Object::init for early IRQvisibility.
petalogix_ml605_mmu: Fix machine node attachment
Just attach devices straight to the root machine node, rather than the"unattached node"
petalogix_ml605_mmu: Attach ethernet to machine
Explicitly make the ethernet a child of the machine. This is needed to setand use links pre-realize. Also makes the ethernet initialization consistentwith its peer DMA.
xilinx_axienet: Create Proxy object for stream
Create a separate child object to proxy the stream slave connection. This issetup for future work where a second stream slave connection is needed. Thenew child object is created at qdev init time and is linked back to the parent...
xilinx_axidma: Create Proxy object for stream
gtk: custom cursor support
Makes gtk ui play nicely with qxl (and vmware_svga)as you can actually see your pointer now ;)
qxl: register QemuConsole for secondary cards
Hook secondary qxl cards properly into the qemu console subsystem.
xen: re-enable refresh interval reporting for xenfb
xenfb informs the guest about the gui refresh interval so it can avoidpointless work. That logic was temporarely disabled for theDisplayState reorganization. Restore it now, with a proper interfacefor it....
console: add qemu_console_is_*
console: allow pinning displaychangelisteners to consoles
DisplayChangeListener gets a new QemuConsole field, which can be set tonon-NULL before registering. This will pin the QemuConsole, so thatparticular DisplayChangeListener will not follow console switches....
qxl: add 4k + 8k resolutions
console: add GraphicHwOps
Pass a single GraphicHwOps struct pointer to graphic_console_init,instead of a bunch of function pointers.
console: gui timer fixes
Make gui update rate adaption code in gui_update() actually work.Sprinkle in a tracepoint so you can see the code at work. Removethe update rate adaption code in vnc and make vnc simply use thegeneric bits instead.
console: give each QemuConsole its own DisplaySurface
Go away from the global DisplaySurface, give one to each QemuConsoleinstead. With this patch applied it is possible to callgraphics_hw_* functions with qemu consoles which are not the currentforeground console....
console: simplify screendump
Screendumps are alot simpler as we can update non-activeQemuConsoles now. So we only need to update the QemuConsolewe want write out, then dump the DisplaySurface content intoa ppm file. Done.
No console switching needed. No special support code in the...
console: zap g_width + g_height
We have a surface per QemuConsole now, so there is no need to keeptrack of the QemuConsole size any more as we can query the surfacesize directly at any time.
console: move gui_update+gui_setup_refresh from vl.c into console.c
Pure code motion, no functional changes.
console: make DisplayState private to console.c
With gui_* being moved to console.c nobody outside console.c needsaccess to DisplayState fields any more. Make the struct private.