summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-11-14Update version to 1.0-rc2v1.0-rc2Anthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-14pc_piix: set qxl revision to 2 for pc-0.14Alon Levy1-0/+12
The default is still 3, and I didn't change older machine types. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-14hw/omap_gpio: Fix infinite recursion when doing 8/16 bit readsPeter Maydell1-1/+1
Fix a long-standing bug which meant that any attempt to do an 8 or 16 bit read from the OMAP GPIO module would cause qemu to crash due to an infinite recursion. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-14Revert bugfix e7852674d5 until tested or until after the release.Andrzej Zaborowski1-3/+2
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-11-14hw/onenand: reject read-only drivesJuha Riihimäki1-0/+5
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-11-14hw/nand: reject read-only drivesJuha Riihimäki1-8/+14
also gracefully fail on nand_device_init() for unsupported block size instead of aborting. Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-11-14hw/arm_sysctl: Fix RESETCTL for realview-pb-a8 and -pbx-a9Jean-Christophe DUBOIS1-6/+21
Depending on the considered baseboard the bit used to reset the platform is different. Here is the list of considered Realview/Versatile platforms: Realview/Versatile AB for ARM926EJ-S: BOARD_ID = 0x100 = BOARD_ID_PB9 http://infocenter.arm.com/help/topic/com.arm.doc.dui0225d/CACCIFGI.html RealView Emulation Baseboard: BOARD_ID = 0x140 = BOARD_ID_EB No reset register RealView PB for Cortex-A8: BOARD_ID = 0x178 = BOARD_ID_PBA8 http://infocenter.arm.com/help/topic/com.arm.doc.dui0417d/BBACIGAD.html RealView PB for Cortex-A9: BOARD_ID = 0x182 = BOARD_ID_PBX http://infocenter.arm.com/help/topic/com.arm.doc.dui0440b/CACCHBFB.html Motherboard Express =C2=B5ATX: BOARD_ID = 0x190 = BOARD_ID_VEXPRESS No reset register Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-11-14hw/pxa2xx.c: Fix handling of RW bits in PMCRPeter Maydell1-0/+1
Fix an error in commit afd4a6522 which meant that writing a zero to the RW bits in the PMCR wouldn't actually clear them. (Error spotted by Andrzej Zaborowski.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-11-14hw/usb-net.c: Fix precedence bug when checking rndis_statePeter Maydell1-2/+3
"!X == 2" is always false (spotted by Coverity), so the checks for whether rndis is in the correct state would never fire. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-11-13memory: fix 'info mtree' segfaultsAvi Kivity1-2/+2
'info mtree' accesses invalid memory in two cases, both due to incorrect (and unsafe) usage of QTAILQ_FOREACH_SAFE(). Reported-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
2011-11-11Merge remote-tracking branch 'kwolf/block-stable' into stagingAnthony Liguori20-189/+383
2011-11-11vl.c: prohibit simultaneous use of -icount with kvm or xenMax Filippov1-0/+5
With -icount, The vm_clock is updated with help from TCG (it counts instructions at 2^ICOUNT ns/instructions). With KVM, the instruction count is not available so KVM cannot provide this help. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11hw/arm_timer.c: Fix bounds check for Integrator timer accessesPeter Maydell1-2/+2
There are only three counter/timers on the integrator board: correct the bounds check to avoid an array overrun. (Spotted by Coverity, see bug 887883). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11hw/pxa2xx.c: Fix handling of R/WC bits in PMCRPeter Maydell1-1/+3
Fix a bug in handling the write-one-to-clear bits in the PMCR which meant that we would always clear the bit even if the value written was a zero. Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11hw/pl061: Remove pointless comparison of array to nullPeter Maydell1-1/+1
Remove a pointless comparison of an array to null. (There is no need to check whether s->out[i] is non-null as qemu_set_irq will do that for us.) Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11hw/tc58128.c: Remove unnecessary check for g_malloc failurePeter Maydell1-5/+1
Remove a check for g_malloc failing: this never happens. Also use g_malloc rather than g_malloc0 as we immediately memset the entire region and so zero-initialising it is pointless. Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11linux-user/elfload.c: Don't memset(NULL..) if malloc() failedPeter Maydell2-4/+3
If a malloc() in copy_elf_strings() failed we would call memset() before the "did malloc fail?" check. Fix this by moving to the glib alloc/free routines for this memory so we can use g_try_malloc0 rather than having a separate memset(). Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11hw/omap_intc.c: Avoid crash on access to nonexistent banked registersPeter Maydell1-0/+6
Avoid a crash due to null pointer dereference if a guest attempts to access banked registers for a nonexistent bank. Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11os-posix: Plug fd leak in qemu_create_pidfile()Markus Armbruster1-0/+3
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11posix-aio-compat: Plug memory leak on paio_init() error pathMarkus Armbruster1-0/+1
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11qemu-sockets: Plug fd leak on unix_connect_opts() error pathMarkus Armbruster1-0/+1
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11ui: Plug memory leaks on parse_keyboard_layout() error pathMarkus Armbruster1-5/+7
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11qemu-char: Plug memory leak on qemu_chr_open_pty() error pathMarkus Armbruster1-9/+10
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11migration: fix detached migration with fdJuan Quintela1-2/+10
Migration with fd uses s->mon to pass the fd. But we only assign the s->mon for !detached migration. Fix it. Once there add a comment indicating that s->mon has two uses. Bug reported by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Juan Quintela <quintela@redhat.com> CC: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11configure: Do not use 'sed -i'Pavel Borzenkov1-1/+5
'sed -i' is not defined in POSIX. It doesn't work on Mac OS X the way it's used in configure (without suffix argument). This patch implements Peter Maydell's idea of xattr.h detection. Cc: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11vl.c: Fail gracefully if no machine is foundAndreas Färber1-0/+5
machine defaults to find_default_machine(), then gets overridden via -M and machine_parse(). If no -M is specified and find_default_machine() returns NULL (when no machine compiled in), exit with an error. Avoids a segfault when setting machine->max_cpus. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-11block: Make cache=unsafe flush to the OSKevin Wolf1-3/+7
cache=unsafe completely ignored bdrv_flush, because flushing the host disk costs a lot of performance. However, this means that qcow2 images (and potentially any other format) can lose data even after the guest has issued a flush if the qemu process crashes/is killed. In case of a host crash, data loss is certainly expected with cache=unsafe, but if just the qemu process dies this is a bit too unsafe. Now that we have two separate flush functions, we can choose to flush everythign to the OS, but don't enforce that it's physically written to the disk. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11block: Introduce bdrv_co_flush_to_osKevin Wolf3-3/+27
qcow2 has a writeback metadata cache, so flushing a qcow2 image actually consists of writing back that cache to the protocol and only then flushes the protocol in order to get everything stable on disk. This introduces a separate bdrv_co_flush_to_os to reflect the split. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11block: Rename bdrv_co_flush to bdrv_co_flush_to_diskKevin Wolf11-45/+59
There are two different types of flush that you can do: Flushing one level up to the OS (i.e. writing data to the host page cache) or flushing it all the way down to the disk. The existing functions flush to the disk, reflect this in the function name. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11hw/pc.c: Fix use-while-uninitialized of fd_type[]Peter Maydell1-3/+1
Fix a use-while-uninitialized of the fd_type[] array (introduced in commit 34d4260e1, noticed by Coverity). This is more theoretical than practical, since it's quite hard to get here with floppy==NULL (the qdev_try_create() of the isa-fdc device has to fail). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11block: Fix vpc initialization of the Dynamic Disk HeaderCharles Arnold1-1/+5
The Data Offset field in the Dynamic Disk Header is an 8 byte field. Although the specification (2006-10-11) gives an example of initializing only the first 4 bytes, images generated by Microsoft on Windows initialize all 8 bytes. Failure to initialize all 8 bytes results in errors from utilities like Citrix's vhd-util which checks specifically for the proper Data Offset field initialization. Signed-off-by: Charles Arnold <carnold@suse.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11qemu-nbd: open the block device after starting the client threadPaolo Bonzini1-17/+17
This is cleaner, because we do not need to close the block device when there is an error opening /dev/nbdX. It was done this way only to print errors before daemonizing. At the same time, use atexit to ensure that the block device is closed whenever we exit. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11qemu-nbd: fix socket creation racePaolo Bonzini1-15/+15
Now that the client and server are in the same process, there is no need to race on the creation of the socket. We can open the listening socket before starting the client thread. This avoids that "qemu-nbd -v -c" prints this once before connecting successfully to the socket: connect(unix:/var/lock/qemu-nbd-nbd0): No such file or directory Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11qemu-nbd: print error messages from the daemon through a pipePaolo Bonzini1-9/+59
In order to get nice error messages, keep the qemu-nbd process running until before issuing NBD_DO_IT and connected to the daemon with a pipe. This lets the qemu-nbd process relay error messages from the daemon and exit with a nonzero status if appropriate. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11qemu-nbd: move client to a threadPaolo Bonzini1-80/+93
This avoids that qemu-nbd uses both forking and threads, which do not behave well together. qemu-nbd is already Unix only, and there is no qemu_thread_join, so for now use pthreads. Since the parent and child no longer have separate file descriptors, we can open the NBD device before daemonizing, instead of checking with access(2) and restricting the open to the client only. Reported-by: Pierre Riteau <pierre.riteau@irisa.fr> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11qemu-nbd: rename socket variablePaolo Bonzini1-13/+12
It will be moved to a global variable by the next patch, and it would conflict with the socket function. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11qemu-nbd: trap SIGTERMPaolo Bonzini1-5/+29
The client process right now uses SIGTERM to interrupt the server side. This does not affect the exit status of "qemu-nbd -v -c" because the server is a child process. This will change when both sides will be in the same process, and anyway cleaning up things nicely upon SIGTERM is good practice. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11nbd: treat EPIPE from NBD_DO_IT as successPaolo Bonzini1-0/+7
This can be seen with "qemu-nbd -v -c", which returns 1 instead of 0 when you disconnect with "qemu-nbd -d". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11scsi-disk: implement eject requestsPaolo Bonzini1-3/+21
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11atapi: implement eject requestsPaolo Bonzini2-3/+21
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11block: add eject request callbackPaolo Bonzini3-4/+23
Recent versions of udev always keep the tray locked so that the kernel can observe "eject request" events (aka tray button presses) even on discs that aren't mounted. Add support for these events in the ATAPI and SCSI cd drive device models. To let management cope with the behavior of udev, an event should also be added for "tray opened/closed". This way, after issuing an "eject" command, management can poll until the guests actually reacts to the command. They can then issue the "change" command after the tray has been opened, or try with "eject -f" after a (configurable?) timeout. However, with this patch and the corresponding support in the device models, at least it is possible to do a manual two-step eject+change sequence. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-11vvfat: Fix read-write modeKevin Wolf1-21/+23
vvfat used to directly call into the qcow2 block driver instead of using the block.c wrappers. With the coroutine conversion, this stopped working. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2011-11-10hw/lan9118.c: Add missing 'break' to fix buffer overrunPeter Maydell1-0/+1
Add a missing 'break' statement to fix a buffer overrun when executing the EEPROM write-all command. Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-10x86/cpuid: Fix crash on -cpu ""Markus Armbruster1-2/+2
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-10x86/cpuid: Plug memory leak in cpudef_setfield()Markus Armbruster1-0/+1
To reproduce the leak, put two name options into the same [cpudef] section of target-x86_64.conf. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-10x86/cpuid: Convert remaining strdup() to g_strdup()Markus Armbruster1-4/+4
Fixes missing error checking. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-10ui/vnc: Convert sasl.mechlist to g_malloc() & friendsMarkus Armbruster1-14/+5
Fixes protocol_client_auth_sasl_mechname() not to crash when malloc() fails. Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-10qdev: Fix crash on -device '?=x'Markus Armbruster1-1/+1
Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-10configure: Show --cpu option on the help list陳韋任1-0/+1
Signed-off-by: Chen Wen-Ren (陳韋任) <chenwj@iis.sinica.edu.tw> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-10qemu-tech.texi: Update default code cache size陳韋任1-1/+1
Update the document since the default code cache size is 32 MB now. Signed-off-by: chenwj <chenwj@cs.nctu.edu.tw> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>