summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-04-22raw-posix: Use bdrv_open options instead of filenameKevin Wolf1-12/+45
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-04-22block: Enable filename optionKevin Wolf1-4/+27
This allows using the file.filename option instead of the string that comes from -drive file=... and is passed around as a separate parameter. The goal is to get rid of this parameter and use the options QDict more consistently. With this option you can access not only the top-level image, but specify a filename for the backing file (currently only if no backing file exists, but we'll allow overriding it later) Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-04-22block: Add driver-specific options for backing filesKevin Wolf3-6/+25
Options starting in "backing." are passed to the backing file now. If you don't need to specify the filename for the backing file, you can add it on the command line instead of in the image file: $ qemu-nbd -t /tmp/test.img $ qemu-img create -f qcow2 empty.qcow2 1G $ qemu-system-x86_64 -drive file=empty.qcow2,backing.file.driver=nbd,\ backing.file.host=localhost Note that this doesn't override the backing filename from the image. If the image has one, this will fail because NBD doesn't want the options and a filename at the same time. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-04-22block: Fail gracefully when using a format driver on protocol levelKevin Wolf3-0/+24
Specifying the wrong driver could fail an assertion: $ qemu-system-x86_64 -drive file.driver=qcow2,file=x qemu-system-x86_64: block.c:721: bdrv_open_common: Assertion `file != ((void *)0)' failed. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-04-22qemu-iotests: Fix _filter_qemuKevin Wolf1-1/+1
$QEMU_PROG happens to be 'qemu' in my setup, so this sed command replaces a bit too much. Restrict it to the start of the line and to when it's followed by a colon, i.e. the form used by error messages. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-22qemu-img: do not zero-pad the compressed write bufferStefan Hajnoczi1-6/+2
bdrv_write_compressed() does not allow requests that span the end of the device. Therefore it is useless to zero-pad the last cluster and thereby exceed the end of the device. Let image formats handle zero-padding the final compressed cluster, if necessary. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-04-22qcow: allow sub-cluster compressed write to last clusterStefan Hajnoczi1-2/+15
Compression in qcow requires image length to be a multiple of the cluster size. Lift this requirement by zero-padding the final cluster when necessary. The virtual disk size is still not cluster-aligned, so the guest cannot access the zero sectors. Note that this is almost identical to the qcow2 version of this code. qcow2's compression code is drawn from qcow. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-04-22qcow2: allow sub-cluster compressed write to last clusterStefan Hajnoczi1-2/+15
Compression in qcow2 requires image length to be a multiple of the cluster size. Lift this requirement by zero-padding the final cluster when necessary. The virtual disk size is still not cluster-aligned, so the guest cannot access the zero sectors. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-04-21ui/cocoa.m: Fix recent compile breakagePeter Maydell1-4/+4
Fix failures to compile introduced by recent console commits 1dbfa00503, 81c0d5a6) which removed is_graphic_console() and vga_hw_update() without updating the cocoa UI backend to match. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-04-20i386 ROR r8/r16 instruction fixPavel Dovgaluk1-0/+1
Fixed EFLAGS corruption by ROR r8/r16 instruction located at the end of the TB. Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@gmail.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-04-20qdev: Drop taddr propertiesPeter Maydell10-96/+0
Drop all the infrastructure for taddr properties (ie ones which are 'hwaddr' sized). These are now unused, and any further desired use would be rather questionable since device properties shouldn't generally depend on a type that is conceptually variable based on the target CPU. 32 or 64 bit integer properties should be used instead as appropriate for the specific device. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-04-20hw/sm501: Use correct setter for sysbus-ohci dma-address propertyPeter Maydell1-1/+1
The sysbus-ohci dma-address property is declared as a HEX64 property, not a TADDR, so use the correct setter for it. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Andreas Färber <afaerber@suse.de> Tested-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-04-20Merge branch 'arm-devs.next' of git://git.linaro.org/people/pmaydell/qemu-armBlue Swirl3-61/+371
* 'arm-devs.next' of git://git.linaro.org/people/pmaydell/qemu-arm: hw/versatile_pci: Drop unnecessary vpb_pci_config_addr() versatile_pci: Expose PCI memory space to system arm/realview: Fix mapping of PCI regions versatile_pci: Implement the PCI controller's control registers versatile_pci: Implement the correct PCI IRQ mapping versatile_pci: Put the host bridge PCI device at slot 29 versatile_pci: Use separate PCI I/O space rather than system I/O space versatile_pci: Change to subclassing TYPE_PCI_HOST_BRIDGE versatile_pci: Update to realize and instance init functions versatile_pci: Expose PCI I/O region on Versatile PB versatile_pci: Fix hardcoded tabs
2013-04-20Merge branch 'target-arm.next' of git://git.linaro.org/people/pmaydell/qemu-armBlue Swirl5-216/+222
* 'target-arm.next' of git://git.linaro.org/people/pmaydell/qemu-arm: target-arm: Correctly restore FPSCR target-arm: Add some missing CPU state fields to VMState target-arm: port ARM CPU save/load to use VMState target-arm: Reinsert missing return statement in ARM mode SRS decode
2013-04-20Merge branch 'linux-user-for-upstream' of ↵Blue Swirl1-4/+4
git://git.linaro.org/people/rikuvoipio/qemu * 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu: linux-user: fix setgroups/getgroups for non-UID16 archs linux-user: fix undefined shift in copy_to_user_fdset linux-user: change do_semop to return target errno when unsuccessful
2013-04-19Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori22-51/+46
# By Stefan Weil (3) and others # Via Stefan Hajnoczi * stefanha/trivial-patches: m25p80: Remove bogus include of devices.h ssh: Remove unnecessary use of strlen function. block/ssh: Add missing gcc format attributes linux-user: change do_semop to return target errno when unsuccessful w64: Fix compiler warnings (wrong format specifier) Remove unneeded type casts virtio.h: drop unused function prototypes bswap: fix compiler warning Message-id: 1366371241-23430-1-git-send-email-stefanha@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-19Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori8-79/+422
pci: add pci test device This adds a new device that we can use for testing PCI PIO and MMIO, with and without ioeventfd in different configurations. FAST_MMIO will be added if/when kvm supports it. Also included are minor cleanups in kvm APIs that it needs. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 15 Apr 2013 05:42:24 PM CDT using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Michael S. Tsirkin # Via Michael S. Tsirkin * mst/tags/for_anthony: pci: add pci test device kvm: support non datamatch ioeventfd kvm: support any size for pio eventfd kvm: remove unused APIs Message-id: cover.1366272004.git.mst@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-19Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori4-3/+58
# By Jan Kiszka (4) and Marcelo Tosatti (1) # Via Marcelo Tosatti * qemu-kvm/uq/master: vmxcap: Update according to SDM of January 2013 target-i386: kvm: save/restore steal time MSR vmxcap: Report APIC register emulation and RDTSCP control vmxcap: Augment reported information vmxcap: Open MSR file in unbuffered mode Message-id: cover.1366253306.git.mtosatti@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-19target-arm: Correctly restore FPSCRPeter Maydell1-7/+41
Use the helper functions to save and restore the FPSCR, so that we correctly propagate rounding mode and flushing behaviour into the float_status fields. This also allows us to stop saving the vector length/stride fields separately. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-04-19target-arm: Add some missing CPU state fields to VMStatePeter Maydell1-3/+10
A number of CPU state fields were accidentally omitted from our migration state: some OMAP specific cp15 registers, and some related to state for load/store exclusive insns. Add them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-04-19target-arm: port ARM CPU save/load to use VMStateJuan Quintela4-215/+179
Port the ARM CPU save/load code to use VMState. Some state is saved in a slightly different order to simplify things -- for example arrays are saved one after the other rather than 'striped', and we always save all 32 VFP registers even if the CPU happens to only have 16. Use one subsection for each feature. This means that we don't need to bump the version field each time that a new feature gets introduced. Signed-off-by: Juan Quintela <quintela@redhat.com> [PMM: fixed conflicts, updated to use cpu_class_set_vmsd(), updated with new/removed fields since original patch, changed to use custom VMStateInfo for cpsr rather than presave/postload hooks, corrected subsection names so vmload doesn't fail] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-04-19target-arm: Reinsert missing return statement in ARM mode SRS decodePeter Chubb1-0/+1
Since patch 81465888c5306cd94abb9847e560796fd13d3c2f target-arm: factor out handling of SRS instruction the ARM mode SRS instruction has not worked in QEMU. The problem is a missing return directive that was removed in the refactoring, so after decoding the instruction, qemu would fall through to generate an UNDEF exception for an illegal instruction. Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-04-19hw/versatile_pci: Drop unnecessary vpb_pci_config_addr()Peter Maydell1-7/+2
Drop the vpb_pci_config_addr() function -- it is unnecessary since the size of the memory regions means the hwaddr is always within the 24 bit size. (This function was probably a leftover from when read/write functions were called with absolute addresses rather than relative ones.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paul Brook <paul@codesourcery.com>
2013-04-19versatile_pci: Expose PCI memory space to systemPeter Maydell3-1/+77
The VersatilePB's PCI controller exposes the PCI memory space to the system via three regions controlled by the mapping control registers. Implement this so that guests can actually use MMIO-BAR PCI cards. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paul Brook <paul@codesourcery.com>
2013-04-19arm/realview: Fix mapping of PCI regionsPeter Maydell1-9/+9
Fix the mapping of the PCI regions for the realview board, which were all incorrect. (This was never noticed because the Linux kernel doesn't actually include a PCI driver for the realview boards.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paul Brook <paul@codesourcery.com>
2013-04-19versatile_pci: Implement the PCI controller's control registersPeter Maydell3-11/+130
The versatile_pci PCI controller has a set of control registers which handle the mapping between PCI and system address spaces. Implement these registers (though for now they have no effect since we don't implement mapping PCI space into system memory at all). The most natural order for our sysbus regions has the control registers at the start, so move all the others down one. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paul Brook <paul@codesourcery.com>
2013-04-19versatile_pci: Implement the correct PCI IRQ mappingPeter Maydell1-6/+99
Implement the correct IRQ mapping for the Versatile PCI controller; it differs between realview and versatile boards, but the previous QEMU implementation was correct only for the first PCI card on a versatile board, since we weren't swizzling IRQs based on the slot number. Since this change would otherwise break any uses of PCI on Linux kernels which have an equivalent bug (since they have effectively only been tested against QEMU, not real hardware), we implement a mechanism for automatically detecting those broken kernels and switching back to the old mapping. This works by looking at the values the kernel writes to the PCI_INTERRUPT_LINE register in the config space, which is effectively the interrupt number the kernel expects the device to be using. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-04-19versatile_pci: Put the host bridge PCI device at slot 29Peter Maydell1-0/+2
On real hardware the host bridge appears as a PCI device in slot 29, so make QEMU put its host bridge in that slot too. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paul Brook <paul@codesourcery.com>
2013-04-19versatile_pci: Use separate PCI I/O space rather than system I/O spacePeter Maydell1-4/+13
Rather than overloading the system I/O space (which doesn't even make any sense on ARM) for PCI I/O, create an memory region in the PCI controller and use that to represent the I/O space. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paul Brook <paul@codesourcery.com>
2013-04-19versatile_pci: Change to subclassing TYPE_PCI_HOST_BRIDGEPeter Maydell1-11/+30
Change versatile_pci to subclass TYPE_PCI_HOST_BRIDGE and generally handle PCI in a more QOM-like fashion. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paul Brook <paul@codesourcery.com>
2013-04-19versatile_pci: Update to realize and instance init functionsPeter Maydell1-25/+25
Update the Versatile PCI controller to use a realize function rather than SysBusDevice::init. To reflect the fact that the 'realview_pci' class is taking most of its implementation from 'versatile_pci' (and to make the QOM casts work) we make 'realview_pci' a subclass of 'versatile_pci'. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paul Brook <paul@codesourcery.com>
2013-04-19versatile_pci: Expose PCI I/O region on Versatile PBPeter Maydell2-7/+4
Comments in the QEMU source code claim that the version of the PCI controller on the VersatilePB board doesn't support the PCI I/O region, but this is incorrect; expose that region, map it in the correct location, and drop the misleading comments. This change removes the only currently implemented difference between the realview-pci and versatile-pci models; however there are other differences in not-yet-implemented functionality, so we retain the distinction between the two device types. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paul Brook <paul@codesourcery.com>
2013-04-19versatile_pci: Fix hardcoded tabsPeter Maydell1-1/+1
There is just one line in this source file with a hardcoded tab indent, so just fix it. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paul Brook <paul@codesourcery.com>
2013-04-19m25p80: Remove bogus include of devices.hPeter Crosthwaite1-1/+0
I think in the early revisions of this we had an instantiation helper for the device in devices.h. This was later removed and this header was left over. Removed Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-19ssh: Remove unnecessary use of strlen function.Richard W.M. Jones1-4/+2
Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-19block/ssh: Add missing gcc format attributesStefan Weil1-2/+2
Now gcc will check whether format string and variable arguments match. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-19linux-user: change do_semop to return target errno when unsuccessfulPetar Jovanovic1-2/+2
do_semop() is called from two places, and one of these fails to convert return error to target errno when semop fails. This patch changes the function to always return target errno in case of an unsuccessful call. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-19w64: Fix compiler warnings (wrong format specifier)Stefan Weil1-2/+2
GetLastError() returns a DWORD value which is unsigned long, so the correct format specifier is %lu. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-19Remove unneeded type castsStefan Weil16-38/+37
cpu_physical_memory_read, cpu_physical_memory_write take any pointer as 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>
2013-04-19virtio.h: drop unused function prototypesLuiz Capitulino1-2/+0
They are unused since commit 5c7d0962f60498c3f11d402e1c857cb9d5d8568d. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-19bswap: fix compiler warningAlexey Kardashevskiy1-0/+1
The bswap functions use memcpy but the bswap.h header itself does not seem to include it in some configuration such as cross compiling for powerpc64 on x86_64 machine. The patch explicitly includes string.h. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-04-19linux-user: fix setgroups/getgroups for non-UID16 archsAndreas Schwab1-3/+3
Don't assume target_id is a short. Signed-off-by: Andreas Schwab <schwab@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-04-19linux-user: fix undefined shift in copy_to_user_fdsetAndreas Schwab1-1/+1
If TARGET_ABI_BITS is bigger than 32 we shift by more than the size of int. Signed-off-by: Andreas Schwab <schwab@suse.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-04-19linux-user: change do_semop to return target errno when unsuccessfulPetar Jovanovic1-2/+2
do_semop() is called from two places, and one of these fails to convert return error to target errno when semop fails. This patch changes the function to always return target errno in case of an unsuccessful call. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-04-18configure: remove duplicate testPaolo Bonzini1-30/+26
We already had a test to add -march=i486 when needed. Make the existing test independent of vhost-net, so that it is also used under Win32. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18configure: CONFIG_NO_XEN is duplicatedPaolo Bonzini2-4/+1
We already define it in Makefile.target. But we need to avoid a curious double negation in order to eliminate it. Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> 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>
2013-04-18configure: eliminate target_libs_softmmuPaolo Bonzini3-5/+5
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18configure: move common libraries to config-host.makPaolo Bonzini2-6/+8
Move -lm to the end of the line, so that it can be picked up as a dependency by pixman in the static build case. 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>
2013-04-18configure: move CONFIG_QEMU_LDST_OPTIMIZATION to config-host.makPaolo Bonzini1-9/+9
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>
2013-04-18elfload: use abi_llong/ullong instead of target_llong/ullongPaolo Bonzini4-8/+12
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>