w64: Don't redefine lseek, ftruncate
MinGW-w64 already defines lseek and ftruncate (and uses the 64 bitvariants). The conditional compilation avoids redefinitions(which would be wrong) and compiler warnings.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
cache-utils: Add missing include file for uintptr_t
Commit 021ecd8b9db37927059f5d3234b51ed766706437 breaks the build forPPC hosts because it uses uintptr_t without the necessary include file.
uintptr_t is defined in stdint.h, so add this include.
Cc: Alexander Graf <agraf@suse.de>...
build: Include config-host.mak as soon as possible
Current code depends on variables defined in config-host.mak before it isactually included.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>Cc: Anthony Liguori <aliguori@us.ibm.com>...
gdbstub: Do not kill target in system emulation mode
Too many VM kittens were killed since 7d03f82f81. Another one just diedunder my fat fingers.
When you quit a kgdb session, does the Linux kernel power off? Or whenyou terminate gdb attached to a hardware debugger, does your board...
target-i386: Mask NX bit from cpu_get_phys_page_debug result
This was a long pending bug, now revealed by the assert inphys_page_find that stumbled over the large page index returned bycpu_get_phys_page_debug for NX-marked pages: We need to mask out NX and...
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Merge remote-tracking branch 'kraxel/usb.42' into staging
xilinx_zynq: fix the build
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
libcacard: Fix compilation with gcc-4.7
VCARD_ATR_PREFIX is used as part of an array initializer so it shouldnot have () around it, so far this happened to work, but gcc-4.7 doesnot like it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
osdep: Remove local definition of macro offsetof
The macro offsetof is defined in stddef.h. It is conforming tothe standards C89, C99 and POSIX.1-2001 (see man page), so itis a sufficiently old standard.
Therefore chances are very high that QEMU never needs a local...
configure: Quote the configure args printed in config.log
Use the same mechanism we use for printing the configure commandline to config-host.mak to print it to config.log. This fixes abug where the config.log version didn't quote arguments with spaces....
libcacard: Use format specifier %u instead of %d for unsigned values
splint reported warnings for those code statements.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
vnc: Add break statement
This was not a bug, but it is not common practice to omit the break statementfrom the last case statement before an empty default case.
Any change of the default case would introduce a bug.
This was reported as a warning by splint....
Spelling fixes in comments (it's -> its)
Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Weil <sw@weilnetz.de>...
libcacard: Spelling and grammar fixes in documentation
v2:Also replace 'aid' by 'AID' (thanks to Peter Maydell for this hint)....
qom: Fix spelling in documentation
This fixes a new spelling issue which was detected by codespell.
qmp: Fix spelling fourty -> forty
This was found by codespell.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Acked-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
block/vmdk: Fix warning from splint (comparision of unsigned value)
l1_entry_sectors will never be less than 0.
Fix sign of sscanf format specifiers
All values read by sscanf are unsigned, so replace %d by %u.
This signed / unsigned mismatch was detected by splint.
sh7750: Remove redundant 'struct' from MemoryRegionOps
The 'struct' is not needed, and all other MemoryRegionOps don't use it.
usb: queue can have async packets
This can happen today in case the ->complete() callback queues up thenext packet. Also we'll support pipelining soon, which allows to havemultiple packets per queue in flight (aka ASYNC) state.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: add pipelining option to usb endpoints
With this patch applied USB drivers can enable pipelining per endpoint.With pipelining enabled the usb core will continue submitting packetseven when there are still async transfers in flight instead of passing...
usb-host: enable pipelineing for bulk endpoints.
We really don't want to wait for packets finish before submitting thenext, we want keep the data flow running.
usb: add shortcut for control transfers
Add a more direct code path to submit control transfers. Instead offeeding three usb packets (setup, data, ack) to usb_handle_packet andhave the do_token_* functions in usb.c poke the control transferparameters out of it just submit a single packet carrying the actual...
xhci: fix control xfers
Use the new, direct control transfer submission method instead ofbypassing the usb core by calling usb_device_handle_control directly.The later fails for async control transfers.
This patch gets xhci + usb-host combo going.
xhci: fix port status
Don't signal port status change if the usb device isn't in attachedstate. Happens with usb-host devices with the pass-through devicebeing plugged out at the host.
usb-ehci: Remove dead nakcnt code
This patch removes 2 bits of dead nakcnt code:
1) usb_ehci_execute calls ehci_qh_do_overlay which does:nakcnt = reload;and then has a block of code which is conditional on:if (reload && !nakcnt) {which ofcourse is never true now as nakcnt == reload....
usb-ehci: Fix and simplify nakcnt handling
The nakcnt code in ehci_execute_complete() marked transactions as finishedwhen a packet completed with a result of USB_RET_NAK, but USB_RET_NAKmeans that the device cannot receive / send data at that time and that...
usb-ehci: Cleanup itd error handling
All error statuses except for NAK are handled in a switch case, move thehandling of NAK into the same switch case.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: return BABBLE rather then NAK when we receive too much data
usb: add USB_RET_IOERROR
We already have USB_RET_NAK, but that means that a device does not wantto send/receive right now. But with host / network redirection we canactually have a transaction fail due to some io error, rather then iethe device just not having any data atm....
uhci_fill_queue: zap debug printf
usb-ehci: split our qh queue into async and periodic queues
qhs can be part of both the async and the periodic schedule, as is shownin later patches in this series it is useful to keep track of the qhs ona per schedule basis.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>...
usb-ehci: always call ehci_queues_rip_unused for period queues
Before this patch USB 2 devices with interrupt endpoints were not workingproperly. The problem is that to avoid loops we stop processing as soonas we encounter a queue-head (qh) we've already seen since qhs can be linked...
usb-ehci: Drop cached qhs when the doorbell gets rung
The purpose of the IAAD bit / the doorbell is to make the ehci controllerforget about cached qhs, this is mainly used when cancelling transactions,the qh is unlinked from the async schedule and then the doorbell gets rung,...
usb-ehci: Rip the queues when the async or period schedule is halted
usb-ehci: Any packet completion except for NAK should set the interrupt
As clearly stated in the 2.3.2 of the EHCI spec, any time USBERRINT getsets then if the td has its IOC bit set USBINT should be set as well.
This means that for any status except for USB_RET_NAK we should set...
usb-ehci: Fix cerr tracking
cerr should only be decremented on errors which cause XactErr to be set, andwhen that happens the failing transaction should be retried until cerr reaches0 and only then should USBSTS_ERRINT be set (and inactive cleared andUSBSTS_INT set if requested)....
usb-redir: Set ep type and interface
Since we don't use usb_desc.c we need to do this ourselves. This fixesiso transfers no longer working for USB 2 devices due to the ep->typecheck in ehci.c
usb-ehci: Never follow table entries with the T-bit set
Before this patch the T-bit was not checked in 2 places, while it should be.
Once we properly check the T-bit everywhere we no longer need the weirdentry < 0x1000 and entry > 0x1000 checks, so this patch removes them....
kvm: fill in padding to help valgrind
valgrind warns about padding fields which are passedto vcpu ioctls uninitialized.This is not an error in practice because kvm ignored padding.Since the ioctls in question are off data path andthe cost is zero anyway, initialize padding to 0...
kvm: x86: Add user space part for in-kernel i8254
This provides the required user space stubs to enable the in-kerneli8254 emulation of KVM.
The in-kernel model supports lost tick compensation according to the"delay" policy. This is enabled by default and can be switched off via a...
kvm: Add kvm_has_pit_state2 helper
To be used for in-kernel PIT emulation.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Avi Kivity <avi@redhat.com>
i8254: Open-code timer restore
Same as for the APIC: To enable migration between accelerated andnon-accelerated models, we need to arm the channel 0 timer only insidethe emulated PIT model. The common code just saves/restores that timerto the the next_transition_time field....
i8254: Factor out base class for KVM reuse
Applying the concept used for the *PICs once again: establish a baseclass for the i8254 that can be used both by the current user spaceemulation and the upcoming KVM in-kernel version. We share most of thepublic interface of the i8254, specifically to the pcspk, vmstate, reset...
cadence_uart: initial version of device model
Implemented cadence UART serial controller
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: John Linn <john.linn@xilinx.com>Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
cadence_ttc: initial version of device model
Implemented cadence Triple Timer Counter (TCC)
cadence_gem: initial version of device model
Device model for cadence gem ethernet controller.
xilinx_zynq: machine model initial version
Xilinx zynq-7000 machine model. Also includes device model for the zynq-specificsystem level control register (SLCR) module.
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>...
petalogix_s2adsp1800: macro'd magic numbers
defined macros for the addresses of the peripherals in machine model
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
qemu-options.hx: allow -dtb argument for all archs
microblaze_boot: enabled -dtb argument
Use the -dtb argument for passing is a custom dtb rather than the oldhardcoded "mb.dtb"
microblaze: factored out common boot code
factored out the copy-pasted common boot code from the two microblaze platformsinto a dedicated microblaze bootloader (microblaze_boot.o).
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>...
petalogix_s2adsp1800: moved rst logic to rst fn
This belongs in the machine specific reset function
Merge branch 's390-for-upstream' of git://repo.or.cz/qemu/agraf
s390: Rework kernel loading: supports elf and newer kernels
This reworks the image loading on s390.
Newer kernels will not always have a 0dd0 (basr 13,0) at address 0x10000.We must not rely on specific code at certain addresses. This check wasintroduced to warn users that tried to load vmlinux, since ELF loading...
Move helpers.h to helper.h
Provides a file naming scheme consistent with other targets.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>Signed-off-by: Alexander Graf <agraf@suse.de>
memory: fix I/O port aliases
Commit e58ac72b6a0 ("ioport: change portio_list not to usememory_region_set_offset()") started using aliases of I/O memoryregions. Since the IORange used for the I/O was contained in thetarget region, the alias information (specifically, the offset...
ioport: add destructor method to IORange
Previously all callers had a containing object with a destructor thatcould be used to trigger cleanup of the IORange objects (typicallyjust freeing the containing object), but a forthcoming memory APIchange doesn't fit this pattern. Rather than setting up a new global...
w64: fix type casts when calling flush_icache_range
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
cache-utils: Change data type of parameters for flush_icache_range
The TCG targets i386 and tci needed a change of the functionprototype for w64.
This change is currently not needed here, but it can be appliedto avoid code differences.
w64: Change data type of parameters for flush_icache_range
This change is currently not needed for the other TCG targets,but it can be applied to avoid code differences.
Cc: Blue Swirl <blauwirbel@gmail.com>...
w64: Fix data type of parameters for flush_icache_range
flush_icache_range takes two address parameters which must be largeenough to address any address of the host.
For hosts with sizeof(unsigned long) == sizeof(void *), this patchchanges nothing. All currently supported hosts fall into this category....
tcg: Rearrange definitions and include statements
This change makes tcg_target_ulong available in tcg-target.h.
w64: Fix size of ram_addr_t
ram_addr_t must be large enough to address any address of the host.
For hosts with sizeof(unsigned long) == sizeof(void *), this patchchanges nothing. All currently supported hosts fall into this category.
For w64 hosts, sizeof(unsigned long) is 4 while sizeof(void *) is 8,...
Merge branch 'upstream' of git://qemu.weilnetz.de/qemu
usb: Fix signature of stub usb_host_device_open
This was a breakage of 3741715cf2.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Merge branch 'xtensa' of git://jcmvbkbc.spb.ru/dumb/qemu-xtensa
hw/arm11mpcore: Fix broken realview_mpcore/arm11mpcore_priv properties
Fix confusion in the Property arrays for the "arm11mpcore_priv" (per-CPU devices for the ARM11MPcore CPU) and "realview_mpcore" (realview-eb board specific device encapsulating CPU and some...
arm: clean up GIC constants
Interrupts numbers 0-31 are private to the processor interface, 32-1019 aregeneral interrupts. Add GIC_INTERNAL and substitute everywhere.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>[Peter Maydell: converted some tabs to spaces]...
arm: make sure that number of irqs can be represented in GICD_TYPER.
We currently assume that the number of interrupts (ITLinesNumber inthe architecture reference manual) is divisible by 32, since wepresent it to the guest when it reads GICD_TYPER (in gic_dist_readb())...
arm: add device tree support
If compiled with CONFIG_FDT, allow user to specify a device tree file usingthe -dtb argument. If the machine supports it then the dtb will be loadedinto memory and passed to the kernel on boot.
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>...
Merge remote-tracking branch 'qemu-kvm/memory/urgent' into staging
Merge remote-tracking branch 'qemu-kvm/memory/core' into staging
kvm: fix unaligned slots
kvm_set_phys_mem() may be passed sections that are not aligned to a pageboundary. The current code simply brute-forces the alignment which leadsto an inconsistency and an abort().
Fix by aligning the start and the end of the section correctly, discarding...
pc-bios: update kvmvapic.bin
Signed-off-by: Avi Kivity <avi@redhat.com>
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'spice/spice.v49' into staging
Merge remote-tracking branch 'kraxel/usb.39' into staging
qemu-img: fix segment fault when the image format is qed
[root@f15 qemu]# qemu-img info /home/zwu/work/misc/rh6.imgimage: /home/zwu/work/misc/rh6.imgfile format: qedvirtual size: 4.0G (4294967296 bytes)disk size: 1.2Gcluster_size: 65536Segmentation fault (core dumped)...
qemu-io: fix segment fault when the image format is qed
[root@f15 qemu]# qemu-io -c info /home/zwu/work/misc/rh6.imgformat name: qedcluster size: 64 KiBvm state offset: 0.000000 bytesSegmentation fault (core dumped)
This reason is same as the former patch...
qemu-iotests: export TEST_DIR for non-bash tests
Since qemu-iotests may need to create large image files it is possibleto specify the test directory. The TEST_DIR variable needs to beexported so non-bash tests can make use of it.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
qemu-iotests: add iotests Python module
Block layer tests that involve QMP commands rather than qemu-img orqemu-io are not well-suited for shell scripting. This patch adds aPython module which allows tests to be written in Python instead.
The basic API is:...
test: add image streaming tests
This patch adds a test suite for the image streaming feature. Itexercises the 'block_stream', 'block_job_cancel', 'block_job_set_speed',and 'query-block-jobs' QMP commands.
qemu-iotests: Filter out DOS line endings
This one makes it possible to run qemu-iotests on a Windows build using Wineand get somewhat meaningful results.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qemu-iotests: 026: Reduce output changes for cache=none qcow2
qemu-iotests supports the -nocache option which makes the tests run withcache=none. For blkdebug tests with qcow2 this means that we may seetest results that differ from cache=writethrough. This patch makes the...
qemu-iotests: Test rebase with short backing file
This tests that qemu-img rebase doesn't assume that the backing file hasthe same size as the image, but considers that it can be smaller.
qemu-tool: revert cpu_get_clock() abort(3)
Despite the fact that the qemu-tool environment has no guest running andvm_clock therefore does not make sense, there is code that gets thevm_clock time even in qemu-tool. Therefore, revert the abort(3) calland just return 0 like we used to. This unbreaks qemu-img/qemu-io with...
QMP: Add qmp command for blockdev-group-snapshot-sync
This adds the QMP command for blockdev-group-snapshot-sync. Ittakes an array in as the input, for the argument devlist. Thearray consists of the following elements:
+ device: device to snapshot. e.g. "ide-hd0", "virtio0"...
qapi: Introduce blockdev-group-snapshot-sync command
This is a QAPI/QMP only command to take a snapshot of a group ofdevices. This is similar to the blockdev-snapshot-sync command, exceptblockdev-group-snapshot-sync accepts a list devices, filenames, and...
qcow2: Fix build with DEBUG_EXT enabled
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: remove unused fields in BlockDriverState
sync_aiocb is unused since commit ce1a14d (Dynamically allocate AIOCompletion Blocks., 2006-08-07).
private is unused since commit 56a1493 (drive cleanup fixes., 2009-09-25).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
block: drop aio_multiwrite in BlockDriver
These were never used.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: Fix offset in qcow2_read_extensions
The spec says that the length of extensions is padded to 8 bytes, notthe offset. Currently this is the same because the header size is amultiple of 8, so this is only about compatibility with future changesto the header size....
qcow2: Reject too large header extensions
Image files that make qemu-img info read several gigabytes into theunknown header extensions list are bad. Just fail opening the imageif an extension claims to be larger than the header extension area.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
fdc: DIR (Digital Input Register) should return status of current drive...
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: fail I/O to empty disk
Requesting a read or a write operation on an empty disk can leadto QEMU dumping core.
Also fix a few braces here and there.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...