summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-02-01Merge remote-tracking branch 'agraf/s390-for-upstream' into stagingAnthony Liguori8-33/+42
# By Andreas Färber # Via Alexander Graf * agraf/s390-for-upstream: target-s390x: Pass S390CPU to s390_{add, del}_running_cpu() target-s390x: Clean up cpu_inject_*() signatures target-s390x: Fix debug output target-s390x: Fix debug output (continued)
2013-02-01Merge remote-tracking branch 'agraf/ppc-for-upstream' into stagingAnthony Liguori6-43/+35
# By Andreas Färber (2) and Alexander Graf (1) # Via Alexander Graf * agraf/ppc-for-upstream: target-ppc: Fix build for PPC_DEBUG_DISAS target-ppc: Fix unused variable warning for FLUSH_ALL_TLBS PPC: Unify dcbzl code path
2013-02-01block/raw-posix: Build fix for O_ASYNCAndreas Färber1-1/+10
Commit eeb6b45d48800e96f67ef2a5c80332557fd45ddb (block: raw-posix image file reopen) broke the build on OpenIndiana. illumos has no O_ASYNC. Exclude it from flags to be compared and instead assert that it is not set where defined. Cf. e61ab1da7e98357da47c54d8f893b9bd6ff2f7f9 for qemu-ga. Cc: qemu-stable@nongnu.org (1.3.x) Cc: Jeff Cody <jcody@redhat.com> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01vmdk: Allow space in file namePhilipp Hahn1-9/+1
The previous scanf() format string stopped parsing the file name on the first white white space, which seems to be allowed at least by VMware Workstation. Change the format string to collect everything between the first and second quote as the file name, disallowing line breaks. Signed-off-by: Philipp Hahn <hahn@univention.de> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01parallels: Fix bdrv_open() error handlingKevin Wolf1-8/+15
Return -errno instead of -1 on errors. Hey, no memory leak to fix here while we're touching it! Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01dmg: Use g_free instead of freeKevin Wolf1-9/+9
The buffers are allocated with g_(re)alloc, so use g_free to free them. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01dmg: Fix bdrv_open() error handlingKevin Wolf1-38/+97
Return -errno instead of -1 on errors and add error checks in some places that didn't have one. Passing things by reference requires more correct typing, replaced a few off_ts therefore - with a 32-bit off_t this is even a fix for truncation bugs. While touching the code, fix even some more memory leaks than in the other drivers... Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01vpc: Fix bdrv_open() error handlingKevin Wolf1-12/+30
Return -errno instead of -1 on errors. While touching the code, fix a memory leak. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01cloop: Fix bdrv_open() error handlingKevin Wolf1-10/+19
Return -errno instead of -1 on errors. While touching the code, fix a memory leak. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01bochs: Fix bdrv_open() error handlingKevin Wolf1-7/+15
Return -errno instead of -1 on errors. While touching the code, fix a memory leak. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01sheepdog: pass vdi_id to sheep daemon for sd_close()Liu Yuan1-2/+3
Sheep daemon needs vdi_id to identify which vdi is closed to release resources such as object cache. Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Cc: Kevin Wolf <kwolf@redhat.com> Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Liu Yuan <tailai.ly@taobao.com> Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01vmdk: Allow selecting SCSI adapter in image creationOthmar Pasteka2-3/+29
Introduce a new option "adapter_type" when converting to vmdk images. It can be one of the following: ide (default), buslogic, lsilogic or legacyESX (according to the vmdk spec from vmware). In case of a non-ide adapter, heads is set to 255 instead of the 16. The latter is used for "ide". Also see LP#545089 Signed-off-by: Othmar Pasteka <pasteka@kabsi.at> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01block: Adds mirroring tests for resized imagesVishvananda Ishaya2-2/+50
This test verifies two mirroring issues are fixed with resized images: * sync='top' creates an image that is the proper size * sync='full' doesn't cause an assertion failure and crash qemu Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01block: Fix is_allocated_above with resized filesVishvananda Ishaya1-1/+3
In an image chain, if the base image is smaller than the current image, we need to make sure to use the current images count of unallocated blocks once we get to the end of the base image. Without this change the code will return 0 blocks when it gets to the end of the base image and mirror_run will fail its assertion. Signed-off-by: Vishvananda Ishaya <vishvananda@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01qemu-iotests: Add regression test for b7ab0feaKevin Wolf3-0/+98
It turned out that the change in b7ab0fea was actually a real qcow2 corruption fix. This is a reproducer for the bug. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-02-01Fix error message in migrate_set_capability HMP commandOrit Wasserman1-1/+1
Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-02-01Allow XBZRLE decoding without enabling the capabilityOrit Wasserman1-3/+0
Before this fix we couldn't load a guest from XBZRLE compressed file. For example: The user activated the XBZRLE capability The user run migrate -d "exec:gzip -c > vm.gz" The user won't be able to load vm.gz and get an error. Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-02-01Fix example for query-migrate-capabilitiesOrit Wasserman1-4/+2
Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2013-02-01Add XBZRLE testingOrit Wasserman2-0/+199
Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-02-01Move XBZRLE encoding code to a separate file to allow testingOrit Wasserman3-160/+174
Signed-off-by: Orit Wasserman <owasserm@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2013-01-31Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori31-158/+180
# By Andreas Färber # Via Andreas Färber * afaerber/qom-cpu: linux-user: bsd-user: Don't reset X86CPU twice target-i386: Pass X86CPU to cpu_x86_set_a20() target-unicore32: Rename CPU subtypes target-openrisc: Rename CPU subtypes target-openrisc: TYPE_OPENRISC_CPU should be abstract target-m68k: Rename CPU subtypes target-m68k: Mark as unmigratable target-s390x: Mark as unmigratable target-sh4: Mark as unmigratable target-xtensa: Mark as unmigratable target-microblaze: Mark as unmigratable target-unicore32: Mark as unmigratable ide/mmio: QOM'ify MMIO IDE for R2D
2013-01-31Merge remote-tracking branch 'afaerber-or/cocoa-for-upstream' into stagingAnthony Liguori1-3/+24
# By Henry Harrington (1) and Stefan Weil (1) # Via Andreas Färber * afaerber-or/cocoa-for-upstream: cocoa: Replace non-portable asprintf() by g_strdup_printf() cocoa: Fix VBE function Set Display Start
2013-01-31Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori11-72/+238
virtio,make,pci,e1000,vfio,piix This includes my timestamp generation cleanup, Amos's and my work on virtio net commands, pci,e1000,vfio and piix fixes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 31 Jan 2013 06:20:27 AM CST using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Michael S. Tsirkin (6) and others # Via Michael S. Tsirkin * mst/tags/for_anthony: vfio-pci: Enable PCIe extended config space PIIX3: reset the VM when the Reset Control Register's RCPU bit gets set ich9: add support for pci assignment virtio-net: rename ctrl rx commands virtio-net: introduce a new macaddr control virtio-net: remove layout assumptions for ctrl vq virtio-net: revert mac on reset rules/mak: make clean should blow away timestamp files Makefile: clean timestamp generation rule rules.mak: cleanup config generation rules e1000: document ICS read behaviour
2013-02-01target-s390x: Pass S390CPU to s390_{add, del}_running_cpu()Andreas Färber6-19/+23
This prepares for moving the halted field to CPUState. Most call sites can already supply S390CPU, for some env becomes unused. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-02-01target-s390x: Clean up cpu_inject_*() signaturesAndreas Färber4-11/+16
Despite cautioning that S390CPU is needed for upcoming CPUState refactorings, commit 5d69c547d947798cba92d836d06f6e017ba2b19d (s390: I/O interrupt and machine check injection.) added functions cpu_inject_io() and cpu_inject_crw_mchk() with CPUS390XState argument, claiming consistency with cpu_inject_ext(). This complicates making cpu_interrupt() take a CPUState even more and it required to pass &cpu->env from some S390CPU-aware call sites already, creating inconsistency elsewhere. Address that. This also eliminates the need for CPUS390XState in s390_virtio_irq(). Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-02-01target-s390x: Fix debug outputAndreas Färber1-1/+1
Commit 71e470886fb6092504503a5fe41092ace71c096c (target-s390x: fix style) renamed the cpu_s390x_handle_mmu_fault() argument from _vaddr to orig_vaddr. Update the debug output code. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-02-01target-s390x: Fix debug output (continued)Andreas Färber1-2/+2
Since its introduction in d5a439645a5a70fed5431318c3bce9dc2caa950f (s390x: helper functions for system emulation) the variable name was raddr. Fix this. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-02-01target-ppc: Fix build for PPC_DEBUG_DISASAndreas Färber1-1/+1
In r5949 / 76db3ba44ee8db671f804755f13b016eefd13288 (target-ppc: memory load/store rework) variable little_endian was replaced with ctx.le_mode. Update the debug code. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-02-01target-ppc: Fix unused variable warning for FLUSH_ALL_TLBSAndreas Färber1-1/+2
Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-02-01PPC: Unify dcbzl code pathAlexander Graf5-41/+32
The bit that makes a dcbz instruction a dcbzl instruction was declared as reserved in ppc32 ISAs. However, hardware simply ignores the bit, making code valid if it simply invokes dcbzl instead of dcbz even on 750 and G4. Thus, mark the bit as unreserved so that we properly emulate a simple dcbz in case we're running on non-G5s. While at it, also refactor the code to check the 970 special case during runtime. This way we don't need to differenciate between a 970 dcbz and any other dcbz anymore. We also allow for future improvements to add e500mc dcbz handling. Reported-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-02-01linux-user: bsd-user: Don't reset X86CPU twiceAndreas Färber2-2/+2
Since commit 65dee38052597b6285eb208125369f01b29ba6c1 (target-i386: move cpu_reset and reset callback to cpu.c) the x86 CPU is reset through cpu_init() but was still reset immediately after in linux-user and bsd-user. Clean this up. Similarly in linux-user/syscall.c it is also reset after cpu_copy(). But that's a bug of its own, fixing which poses a semantic change. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2013-02-01target-i386: Pass X86CPU to cpu_x86_set_a20()Andreas Färber3-5/+8
Prepares for cpu_interrupt() changing argument to CPUState. While touching it, rename to x86_cpu_...() now that it takes an X86CPU. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
2013-02-01target-unicore32: Rename CPU subtypesAndreas Färber2-3/+7
In the initial conversion of CPU models to QOM types, model names were mapped 1:1 to type names. As a side effect this gained us a type "any", which is now a device. To avoid "-device any" silliness and to pave the way for compiling multiple targets into one executable, adopt a <name>-<arch>-cpu scheme. No functional changes for -cpu arguments. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-02-01target-openrisc: Rename CPU subtypesAndreas Färber1-4/+11
Model names were mapped 1:1 to type names. As a side effect this registered a type "any", which is now a device. To avoid "-device any" silliness and to pave the way for compiling multiple targets into one executable, adopt a <name>-<arch>-cpu scheme. No functional changes for -cpu arguments or -cpu ? output. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-02-01target-openrisc: TYPE_OPENRISC_CPU should be abstractAndreas Färber1-1/+1
A basic assumption of CPU subtypes is that only specific models get instantiated. A user is not supposed to instantiate an <arch>-cpu. Suppress it via abstract = true, which also drops or32-cpu from -cpu ? output. Cc: qemu-stable@nongnu.org Cc: Jia Liu <proljc@gmail.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-02-01target-m68k: Rename CPU subtypesAndreas Färber2-5/+14
In the initial conversion of CPU models to QOM types, model names were mapped 1:1 to type names. As a side effect this gained us a type "any", which is now a device. To avoid "-device any" silliness and to pave the way for compiling multiple targets into one executable, adopt a <name>-<arch>-cpu scheme. No functional changes for -cpu arguments or -cpu ? output. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-02-01target-m68k: Mark as unmigratableAndreas Färber3-1/+8
It neither defined CPU_SAVE_VERSION nor implemented cpu_{save,load}(). Mark M68kCPU as unmigratable at device level. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Juan Quintela <quintela@redhat.com>
2013-02-01target-s390x: Mark as unmigratableAndreas Färber3-32/+10
CPU_SAVE_VERSION was undefined, so "cpu_common" VMState and cpu_{save,load}() were not registered. They were no-ops. Therefore there is no backwards compatibility to keep, so we can mark S390CPU as unmigratable at device level. Signed-off-by: Andreas Färber <afaerber@suse.de> Acked-by: Alexander Graf <agraf@suse.de> Reviewed-by: Juan Quintela <quintela@redhat.com>
2013-02-01target-sh4: Mark as unmigratableAndreas Färber3-1/+9
It neither defined CPU_SAVE_VERSION nor implemented cpu{save,load}(). Mark it as unmigratable at device level. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Juan Quintela <quintela@redhat.com>
2013-02-01target-xtensa: Mark as unmigratableAndreas Färber3-39/+9
There was no CPU_SAVE_VERSION defined, so neither "cpu_common" VMState nor cpu_{save,load}() were registered. Their implementation was no-op. Therefore there is no backwards compatibility to keep, so mark XtensaCPU as unmigratable at device level. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Juan Quintela <quintela@redhat.com>
2013-02-01target-microblaze: Mark as unmigratableAndreas Färber4-14/+10
cpu_{save,load} were no-ops, so de facto it is unmigratable and no backwards compatibility to keep. Therefore mark the MicroBlazeCPU as unmigratable at device level the QOM way and suppress "cpu_common" VMState registration by dropping CPU_SAVE_VERSION. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Juan Quintela <quintela@redhat.com>
2013-02-01target-unicore32: Mark as unmigratableAndreas Färber4-26/+9
CPU_SAVE_VERSION 2 was bogus as both save and load would just throw a hw_error(). Therefore we can without problems suppress registration of "cpu_common" VMState by dropping CPU_SAVE_VERSION define and provide an unmigratable "cpu" VMStateDescription for UniCore32CPU at device level instead, where we can attach this the QOM way. Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Juan Quintela <quintela@redhat.com>
2013-02-01ide/mmio: QOM'ify MMIO IDE for R2DAndreas Färber3-25/+82
It was not qdev'ified before, so turn it into a SysBusDevice. Keep mmio_ide_init_drives() around to attach the hard drive. Signed-off-by: Andreas Färberr <afaerber@suse.de> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-01-31target-mips: fix incorrect test for MTHLIPPetar Jovanovic1-1/+1
The pos field in the DSPControl register is not correctly initialized. Per documentation, the result of MTHLIP is unpredictable if the value of the pos field before the execution is greater than 32. Signed-off-by: Petar Jovanovic <petarj@mips.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-01-31target-mips: enable access to DSP ASE if implementedPetar Jovanovic1-4/+2
compute_hflags() will reset DSP h-flags, so MX bit should be initially set for usermode in cpu_state_reset() if DSP ASE is implemented. This change will bring back user-mode support for DSP ASE, since one of the recent changes broke it. Signed-off-by: Petar Jovanovic <petarj@mips.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-01-31target-mips: Unfuse {,N}M{ADD,SUB}.fmtRichard Sandiford1-8/+17
Turn MADD.fmt, MSUB.fmt, NMADD.fmt and NMSUB.fmt from fused to unfused operations, so that they behave in the same way as a separate multiplication and addition. The instructions were only fused in early MIPS IV processors. Signed-off-by: Richard Sandiford <rdsandiford@googlemail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-01-31target-mips: Sign-extend the result of LWRRichard Sandiford1-0/+1
Sign-extend the result of LWR, as is already done for LWL. This is necessary in the case where LWR loads the full word (i.e. the address is actually aligned). In the other cases, it is implementation defined whether the upper 32 bits of the result are unchanged or a copy of bit 31. The latter seems easier to implement. Previously the code used: (oldval & (0xfffffffe << (31 - bitshift))) | (newval >> bitshift) which zeroed the upper bits of the register, losing any previous sign extension in the unaligned cases. Signed-off-by: Richard Sandiford <rdsandiford@googlemail.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-01-31target-mips: Fix signedness of loads in MIPS16 RESTOREsRichard Sandiford1-1/+1
Make RESTORE use sign-extending rather than zero-extending loads. Signed-off-by: Richard Sandiford <rdsandiford@googlemail.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-01-31Merge branch 'target-arm.next' of git://git.linaro.org/people/pmaydell/qemu-armAurelien Jarno3-6/+18
* 'target-arm.next' of git://git.linaro.org/people/pmaydell/qemu-arm: target-arm: Rename CPU types target-arm: Fix TCG temp leaks for WI and UNDEF VFP sysreg writes
2013-01-31target-mips: implement DSP (d)append sub-class with TCGAurelien Jarno3-126/+87
DSP instruction from the (d)append sub-class can be implemented with TCG. Use a different function for these instructions are they are quite different from compare-pick sub-class. Fix BALIGN instruction for negative value, where the value should be zero-extended before being shift to the right. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>