summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* scsi-disk: use scsi_data_cdb_lengthPaolo Bonzini2012-09-211-9/+5
| | | | | | | This simplifies and unifies the parsing of READ, WRITE and WRITE SAME commands. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* scsi: introduce scsi_cdb_length and scsi_data_cdb_lengthPaolo Bonzini2012-09-212-5/+20
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* scsi-disk: fix check for out-of-range LBAPaolo Bonzini2012-09-211-1/+5
| | | | | | | This fix is needed to correctly handle 0-block read and writes. Without it, a 0-block access at LBA 0 would underflow. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* scsi-disk: introduce check_lba_rangePaolo Bonzini2012-09-211-8/+16
| | | | | | | Abstract the test for an out-of-range (starting block, block count) pair. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* iSCSI: We dont need to explicitely call qemu_notify_event() any moreRonnie Sahlberg2012-09-211-6/+0
| | | | | | | | | We no longer need to explicitely call qemu_notify_event() any more since this is now done automatically any time the filehandles we listen to change. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* iSCSI: We need to support SG_IO also from iscsi_ioctl()Ronnie Sahlberg2012-09-211-0/+17
| | | | | | | | | We need to support SG_IO from the synchronous iscsi_ioctl() since scsi-block uses this to do an INQ to the device to discover its properties This patch makes scsi-block work with iscsi. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* target-xtensa: don't emit extra tcg_gen_goto_tbMax Filippov2012-09-211-1/+3
| | | | | | | | | | Unconditional gen_check_loop_end at the end of disas_xtensa_insn can emit tcg_gen_goto_tb with slot id already used in the TB (e.g. when TB ends at LEND with a branch). Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Cc: qemu-stable <qemu-stable@nongnu.org> Signed-off-by: malc <av1474@comtv.ru>
* target-xtensa: fix extui shift amountMax Filippov2012-09-211-3/+21
| | | | | | | | | extui opcode only uses lowermost op1 bit for sa4. Reported-by: malc <av1474@comtv.ru> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Cc: qemu-stable <qemu-stable@nongnu.org> Signed-off-by: malc <av1474@comtv.ru>
* tcg/optimize: fix end of basic block detectionAurelien Jarno2012-09-191-13/+9
| | | | | | | | | | | | | | | | | Commit e31b0a7c050711884ad570fe73df806520953618 fixed copy propagation on 32-bit host by restricting the copy between different types. This was the wrong fix. The real problem is that the all temps states should be reset at the end of a basic block. This was done by adding such operations in the switch, but brcond2 was forgotten (that's why the crash was only observed on 32-bit hosts). Fix that by looking at the TCG_OPF_BB_END instead. We need to keep the case for op_set_label as temps might be modified through another path. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-mips: Implement Loongson Multimedia InstructionsRichard Henderson2012-09-194-4/+1180
| | | | | | | | Implements all of the COP2 instructions except for the S<cond> family of comparisons. The documentation is unclear for those. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-mips: Always evaluate debugging macro argumentsRichard Henderson2012-09-191-14/+17
| | | | | | | | this will prevent some of the compilation errors with debugging enabled from creeping back in. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-mips: Fix MIPS_DEBUG.Richard Henderson2012-09-191-36/+38
| | | | | | | | The macro uses the DisasContext. Pass it around as needed. Signed-off-by: Richard Henderson <rth@twiddle.net> Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-mips: Set opn in gen_ldst_multiple.Richard Henderson2012-09-191-0/+6
| | | | | | | | Used by MIPS_DEBUG, when enabled. Signed-off-by: Richard Henderson <rth@twiddle.net> Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* hw/pflash_cfi0[12]: Use host-utils.h ctz32()Peter Maydell2012-09-192-72/+2
| | | | | | | | | Drop the private reimplementation of ctz32() from pflash_cfi0[12] in favour of using the standard version from host-utils.h. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* pflash_cfi01: fix vendor specific extended queryAurelien Jarno2012-09-191-1/+3
| | | | | | | | | | | | | | | pflash_cfi01 announces a version number of 1.1, which implies "Protection Register Information" and "Burst Read information" sections, which are not provided. Decrease the version number to 1.0 so that only the "Protection Register Information" section is needed. Set the number of protection fields (0x3f) to 0x01, as 0x00 means 256 protections field, which makes the CFI table bigger than the current implementation, causing some kernels to fail to read it. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* revert "TCG: fix copy propagation"Aurelien Jarno2012-09-192-14/+6
| | | | | | | | Given the copy propagation breakage on 32-bit hosts has been fixed commit e31b0a7c050711884ad570fe73df806520953618 can be reverted. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg: mark set_label with TCG_OPF_BB_END flagAurelien Jarno2012-09-192-6/+1
| | | | | | | | | | | | | set_label is effectively the end of a basic block, as no optimization can be made accross it. It was treated as such in the liveness analysis code, but as a special case. Mark it with TCG_OPF_BB_END flag so that this information can be used by other parts of the TCG code, and remove the special case in the liveness analysis code. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg/i386: allow constants in load/store opsAurelien Jarno2012-09-191-13/+37
| | | | | | | | On x86, it is possible to move a constant value to memory. Add code to handle a constant argument to load/store ops. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* xilinx_timer: Fix a compile error if debug enabledChris Wulff2012-09-191-1/+2
| | | | | | | | There was a missing include of qemu-log and a variable name in a printf was out of date. Signed-off-by: Chris Wulff <crwulff@gmail.com> Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
* xilinx: fix names of ethernet and dma links.Peter A. G. Crosthwaite2012-09-191-2/+4
| | | | | | These names were incorrect. Fixed to match to actual link names Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
* xilinx.h: Error check when setting linksPeter A. G. Crosthwaite2012-09-191-2/+8
| | | | | | | Assert that the ethernet and dma controller are sucessfully linked to their peers. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
* xilinx_timer: Fixed "frequency" prop namePeter A. G. Crosthwaite2012-09-192-2/+3
| | | | | | | The "frequency" qdev prop matches the "clock-frequency" property in Xilinx EDK. Renamed "frequency" -> "clock-frequency" accordingly. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
* xilinx_timer: Send dbg msgs to stderr not stdoutPeter A. G. Crosthwaite2012-09-191-4/+4
| | | | Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
* xilinx_timer: Removed comma in device namePeter A. G. Crosthwaite2012-09-192-3/+3
| | | | | | Fixes an error in a61e4b07a30c062260d2d01771773f14820d1eb7 Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
* arch_init.c: Improve '-soundhw help' for non-HAS_AUDIO_CHOICE archsPeter Maydell2012-09-191-0/+5
| | | | | | | | | For architectures which don't set HAS_AUDIO_CHOICE, improve the '-soundhw help' message so that it doesn't simply print an empty list, implying no sound support at all. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: malc <av1474@comtv.ru>
* Merge remote-tracking branch 'kiszka/queues/slirp' into stagingAnthony Liguori2012-09-173-46/+68
|\ | | | | | | | | | | | | | | | | | | * kiszka/queues/slirp: slirp: Implement TFTP Blocksize option slirp: Remove unused return value of tftp_send_next_block slirp: Handle more than 65535 blocks in TFTP transfers slirp: improve TFTP performance slirp: Fix error reported by static code analysis slirp: Remove wrong type casts ins debug statements
| * slirp: Implement TFTP Blocksize optionHervé Poussineau2012-09-141-9/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option is described in RFC 1783. As this is only an optional field, we may ignore it in some situations and handle it in some others. However, MS Windows 2003 PXE boot client requests a block size of the MTU (most of the times 1472 bytes), and doesn't work if the option is not acknowledged (with whatever value). According to the RFC 1783, we cannot acknowledge the option with a bigger value than the requested one. As current implementation is using 512 bytes by block, accept the option with a value of 512 if the option was specified, and don't acknowledge it if it is not present or less than 512 bytes. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
| * slirp: Remove unused return value of tftp_send_next_blockJan Kiszka2012-09-131-9/+5
| | | | | | | | | | | | No caller actually makes use of this value, so let's simplify the code. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
| * slirp: Handle more than 65535 blocks in TFTP transfersHervé Poussineau2012-09-132-14/+11
| | | | | | | | | | | | | | | | | | | | RFC 1350 does not mention block count roll-over. However, a lot of TFTP servers implement it to be able to transmit big files, so do it also. Current block size is 512 bytes, so TFTP files were limited to 32 MB. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
| * slirp: improve TFTP performanceHervé Poussineau2012-09-132-14/+19
| | | | | | | | | | | | | | | | | | When transferring a file, keep it open during the whole transfer, instead of opening/closing it for each block. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
| * slirp: Fix error reported by static code analysisStefan Weil2012-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Report from smatch: slirp/tcp_subr.c:127 tcp_respond(17) error: we previously assumed 'tp' could be null (see line 124) Return if 'tp' is NULL. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
| * slirp: Remove wrong type casts ins debug statementsStefan Weil2012-09-131-3/+3
| | | | | | | | | | | | | | | | The type casts of pointers to long are not allowed when sizeof(pointer) != sizeof(long). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* | Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2012-09-1712-88/+305
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kwolf/for-anthony: block: Don't forget to delete temporary file Don't require encryption password for 'qemu-img info' command qemu-img: Add json output option to the info command. qapi: Add SnapshotInfo and ImageInfo. ahci: properly reset PxCMD on HBA reset block: fix block tray status vdi: Fix warning from clang block/curl: Fix wrong free statement ide: Fix error messages from static code analysis (no real error) ATAPI: STARTSTOPUNIT only eject/load media if powercondition is 0 sheepdog: fix savevm and loadvm
| * | block: Don't forget to delete temporary fileDunrong Huang2012-09-121-1/+5
| | | | | | | | | | | | | | | | | | | | | The caller would not delete temporary file after failed get_tmp_filename(). Signed-off-by: Dunrong Huang <riegamaths@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | Don't require encryption password for 'qemu-img info' commandDaniel P. Berrange2012-09-121-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | The encryption password is only required if I/O is going to be performed on a disk image. The 'qemu-img info' command merely reports metadata, so it should not ask for a decryption password Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qemu-img: Add json output option to the info command.Benoît Canet2012-09-124-49/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This option --output=[human|json] make qemu-img info output on human or JSON representation at the choice of the user. example: { "snapshots": [ { "vm-clock-nsec": 637102488, "name": "vm-20120821145509", "date-sec": 1345553709, "date-nsec": 220289000, "vm-clock-sec": 20, "id": "1", "vm-state-size": 96522745 }, { "vm-clock-nsec": 28210866, "name": "vm-20120821154059", "date-sec": 1345556459, "date-nsec": 171392000, "vm-clock-sec": 46, "id": "2", "vm-state-size": 101208714 } ], "virtual-size": 1073741824, "filename": "snap.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": 985587712, "dirty-flag": false } Signed-off-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | qapi: Add SnapshotInfo and ImageInfo.Benoît Canet2012-09-121-0/+64
| | | | | | | | | | | | | | | Signed-off-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | ahci: properly reset PxCMD on HBA resetJason Baron2012-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While testing q35, I found that windows 7 (specifically, windows 7 ultimate with sp1 x64), wouldn't install because it can't find the cdrom or disk drive. The failure message is: 'A required cd/dvd device driver is missing. If you have a driver floppy disk, CD, DVD, or USB flash drive, please insert it now.' This can also be reproduced on piix by adding an ahci controller, and observing that windows 7 does not see any devices behind it. The problem is that when windows issues a HBA reset, qemu does not reset the individual ports' PxCMD register. Windows 7 then reads back the PxCMD register and presumably assumes that the ahci controller has already been initialized. Windows then never sets up the PxIE register to enable interrupts, and thus it never gets irqs back when it sends ata device inquiry commands. This change brings qemu into ahci 1.3 specification compliance. Section 10.4.3 HBA Reset: " When GHC.HR is set to '1', GHC.AE, GHC.IE, the IS register, and all port register fields (except PxFB/PxFBU/PxCLB/PxCLBU) that are not HwInit in the HBA's register memory space are reset. " I've also re-tested Fedora 16 and 17 to verify that they continue to work with this change. Signed-off-by: Jason Baron <jbaron@redhat.com> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | block: fix block tray statusPavel Hrdina2012-09-121-2/+2
| | | | | | | | | | | | | | | | | | | | | The tray status should change also if you eject empty block device. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | vdi: Fix warning from clangStefan Weil2012-09-121-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ccc-analyzer reports these warnings: block/vdi.c:704:13: warning: Dereference of null pointer bmap[i] = VDI_UNALLOCATED; ^ block/vdi.c:702:13: warning: Dereference of null pointer bmap[i] = i; ^ Moving some code into the if block fixes this. It also avoids calling function write with 0 bytes of data. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | block/curl: Fix wrong free statementStefan Weil2012-09-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Report from smatch: block/curl.c:546 curl_close(21) info: redundant null check on s->url calling free() The check was redundant, and free was also wrong because the memory was allocated using g_strdup. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | ide: Fix error messages from static code analysis (no real error)Stefan Weil2012-09-121-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Report from smatch: hw/ide/core.c:1472 ide_exec_cmd(423) error: buffer overflow 'smart_attributes' 8 <= 29 hw/ide/core.c:1474 ide_exec_cmd(425) error: buffer overflow 'smart_attributes' 8 <= 29 hw/ide/core.c:1475 ide_exec_cmd(426) error: buffer overflow 'smart_attributes' 8 <= 29 ... The upper limit of 30 was never reached because both for loops terminated when 'smart_attributes' reached end of list, so there was no real buffer overflow. Nevertheless, changing the code not only fixes the error report, but also reduces the size of smart_attributes and simplifies the for loops. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | ATAPI: STARTSTOPUNIT only eject/load media if powercondition is 0Ronnie Sahlberg2012-09-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The START STOP UNIT command will only eject/load media if power condition is zero. If power condition is !0 then LOEJ and START will be ignored. From MMC (sbc contains similar wordings too) The Power Conditions field requests the block device to be placed in the power condition defined in Table 558. If this field has a value other than 0h then the Start and LoEj bits shall be ignored. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | sheepdog: fix savevm and loadvmMORITA Kazutaka2012-09-121-1/+2
| |/ | | | | | | | | | | | | | | This patch sets data to be sent to Sheepdog correctly and fixes savevm and loadvm operations on a Sheepdog image. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2012-09-1720-63/+48
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stefanha/trivial-patches: configure: fix seccomp check arch_init.c: add missing '%' symbols before PRIu64 in debug printfs kvm: Fix warning from static code analysis qapi: Fix enumeration typo error console: Clean up bytes per pixel calculation Fix copy&paste typos in documentation comments linux-user: Remove #if 0'd cpu_get_real_ticks() definition ui: Fix spelling in comment (ressource -> resource) Spelling fixes in comments and macro names (ressource -> resource) Fix spelling (licenced -> licensed) in GPL Spelling fixes in comments and documentation srp: Don't use QEMU_PACKED for single elements of a structured type
| * | configure: fix seccomp checkYann E. MORIN2012-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if libseccomp is missing but the user explicitly requested seccomp support using --enable-seccomp, configure silently ignores the situation and disables seccomp support. This is unlike all other tests that explicitly fail in such situation. Fix that. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
| * | arch_init.c: add missing '%' symbols before PRIu64 in debug printfsIgor Mitsyanko2012-09-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | '%' symbols were missing in front of PRIu64 macros in DPRINTF() messages in arch_init.c, this caused compilation warnings when compiled with DEBUG_ARCH_INIT defined. Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
| * | kvm: Fix warning from static code analysisStefan Weil2012-09-141-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Report from smatch: kvm-all.c:1373 kvm_init(135) warn: variable dereferenced before check 's' (see line 1360) 's' cannot by NULL (it was alloced using g_malloc0), so there is no need to check it here. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
| * | qapi: Fix enumeration typo errorLei Li2012-09-142-3/+3
| | | | | | | | | | | | | | | | | | Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
| * | console: Clean up bytes per pixel calculationBALATON Zoltan2012-09-141-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Division with round up is the correct way to compute this even if the only case where division with round down gives incorrect result is probably 15 bpp. This case was explicitely patched up in one of these functions but was unhandled in the other. (I'm not sure about setting 16 bpp for the 15bpp case either but I left that there for now.) Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>