summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* target-mips: fix save_cpu_state() callsqemu-kvm-0.13.0-gentooAurelien Jarno2011-05-271-6/+6
| | | | | | | | | | | The rule is: - don't save PC if the exception is only triggered by softmmu. - save PC if the exception can be triggered by an helper. Fix a 64-bit kernel crash when loading modules. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit b835e919f022d768abdf00e8dc94f1a23fdcab15)
* target-sparc: fix udiv(cc) and sdiv(cc)Aurelien Jarno2011-05-273-18/+50
| | | | | | | | | | | | | | | | Since commit 5a4bb580cdb10b066f9fd67658b31cac4a4ea5e5, Xorg crashes on a Debian Etch image. The commit itself is fine, but it triggers a bug due to wrong computation of flags for udiv(cc) and sdiv(cc). This patch only compute cc_src2 for the cc version of udiv/sdiv. It also moves the update of cc_dst and cc_op to the helper, as it is faster doing it here when there is already an helper. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> (cherry picked from commit 0fcec41eec0432c77645b4a407d3a3e030c4abc4) Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* target-arm: fix bug in translation of REVSHAurelien Jarno2011-05-271-7/+3
| | | | | | | | | | | The translation of REVSH shifted the low byte 8 steps left before performing an 8-bit sign extend, causing this part of the expression to alwas be 0. Reported-by: Johan Bengtsson <teofrastius@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 1a855029af40df40144a322bba0e1e61c68eed2a) Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Add missing dependency.Paul Brook2011-05-271-1/+1
| | | | | | | | | | Teach Makefile that cmd.o depends on a generated header (specifically config-host.h). Signed-off-by: Paul Brook <paul@codesourcery.com> (cherry picked from commit 6e14404aab26f74a448747d1e793ac16bde8a92b) Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Revert "Ignore pci unplug requests for unpluggable devices (CVE-2011-1751)"Doug Goldstein2011-05-271-3/+1
| | | | This reverts commit 10830d286ef279d3f531c74e51bfab409b507f4a.
* Ignore pci unplug requests for unpluggable devices (CVE-2011-1751)Gerd Hoffmann2011-05-261-1/+3
| | | | | | | | | | | This patch makes qemu ignore unplug requests from the guest for pci devices which are tagged as non-hotpluggable. Trouble spot is the piix4 chipset with the ISA bridge. Requests to unplug that one will make it go away together with all ISA bus devices, which are not prepared to be unplugged and thus don't cleanup, leaving active qemu timers behind in free'ed memory. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* TCG: Revert ppc64 tcg_out_movi32 changeAndreas Färber2011-05-251-1/+1
| | | | | | | | | | | | | 3b6dac34161bc0a342336072643c2f6d17e0ec45 apparently broke the ppc64 TCG target compilation in the code path without guest base. Reverting this line fixes the build. Signed-off-by: Andreas F?rber <andreas.faerber@web.de> Cc: malc <av1474@comtv.ru> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Richard Henderson <rth@twiddle.net> Signed-off-by: malc <av1474@comtv.ru>
* virtio-blk: fail unaligned requestsChristoph Hellwig2011-05-251-0/+8
| | | | | | | | | | | | | | Like all block drivers virtio-blk should not allow small than block size granularity access. But given that the protocol specifies a byte unit length field we currently accept such requests, which cause qemu to abort() in lower layers. Add checks to the main read and write handlers to catch them early. Reported-by: Conor Murphy <conor_murphy_virt@hotmail.com> Tested-by: Conor Murphy <conor_murphy_virt@hotmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Merge remote branch 'upstream/stable-0.13' into stable-0.13qemu-kvm-0.13.0Avi Kivity2010-10-1410-89/+171
|\ | | | | | | | | | | | | | | | | | | | | | | | | * upstream/stable-0.13: Update for 0.13.0 release vhost: error code virtio: change set guest notifier to per-device eepro100: Add support for multiple individual addresses (multiple IA) virtio-net: unify vhost-net start/stop virtio: invoke set_status callback on reset net: delay freeing peer host device Signed-off-by: Avi Kivity <avi@redhat.com>
| * Update for 0.13.0 releaseAnthony Liguori2010-10-142-1/+3
| | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * vhost: error codeMichael S. Tsirkin2010-10-121-0/+2
| | | | | | | | | | | | | | fix up errors returned to include errno, not just -1 Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit c885212109b0ad79888ced410c2ff0d0e883cb15)
| * virtio: change set guest notifier to per-deviceMichael S. Tsirkin2010-10-123-26/+57
| | | | | | | | | | | | | | | | | | | | When using irqfd with vhost-net to inject interrupts, a single evenfd might inject multiple interrupts. Implementing this is much easier with a single per-device callback to set guest notifiers. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 54dd932128ae08d6a5a6668551508e30520b0f86)
| * eepro100: Add support for multiple individual addresses (multiple IA)Stefan Weil2010-10-121-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I reviewed the latest sources of Linux, FreeBSD and NetBSD. They all reset the multiple IA bit (multi_ia in BSD) to zero, but I did not find code which sets this bit to one (like it is done by some routers). Running Windows guests also did not set this bit. Intel's Open Source Software Developer Manual does not give much information on the semantics related to this bit, so I had to guess how it works. The guess was good enough to make the router emulation work. Related changes in this patch: * Update naming and documentation of the internal hash register. It is not limited to multicast, but also used for multiple IA. * Dump complete configuration register when debug traces are enabled. * Debug output when multiple IA bit is set during CmdConfigure. * Debug output when frames are received because multiple IA bit is set, or when they are ignored although it is set. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 010ec6293409f10b88631c36145944b9c3277ce1)
| * virtio-net: unify vhost-net start/stopMichael S. Tsirkin2010-10-121-46/+43
| | | | | | | | | | | | | | | | | | | | | | | | Move all of vhost-net start/stop logic to a single routine, and call it from everywhere. Additionally, start/stop vhost-net on link up/down: we should not transmit anything if user asked us to put the link down. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Alex Williamson <alex.williamson@redhat.com>
| * virtio: invoke set_status callback on resetMichael S. Tsirkin2010-10-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | As status is set to 0 on reset, invoke the relevant callback. This makes for a cleaner code in devices as they don't need to duplicate the code in their reset routine, as well as excercises this path a little more. In particular this makes it possible to unify vhost-net handling code with the following patch. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit e0c472d8c2795e523b0f9006dbe5bc22545c8300)
| * net: delay freeing peer host deviceMichael S. Tsirkin2010-10-122-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With -netdev, virtio devices present offload features to guest, depending on the backend used. Thus, removing host netdev peer while guest is active leads to guest-visible inconsistency and/or crashes. As a solution, while guest (NIC) peer device exists, we prevent the host peer from being deleted. This patch does this by adding peer_deleted flag in nic state: if host device is going away while guest device is around, set this flag and keep a shell of the host device around for as long as guest device exists. The link is put down so all packets will get discarded. At the moment, management can detect that device deletion is delayed by doing info net. As a next step, we shall add commands that control hotplug/unplug without removing the device, and an event to report that guest has responded to the hotplug event. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Alex Williamson <alex.williamson@redhat.com> (cherry picked from commit a083a89d7277f3268a251ce635d9aae5559242bd)
* | Merge branch 'upstream-merge' into stable-0.13Avi Kivity2010-10-1338-243/+1355
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream-merge: (39 commits) vnc: check fd before calling qemu_set_fd_handler2() in vnc_client_write() disable guest-provided stats on "info balloon" command Revert "Make default invocation of block drivers safer (v3)" QEMUFileBuffered: indicate that we're ready when the underlying file is ready sparc escc IUS improvements (SunOS 4.1.4 fix) fix last cpu timer initialization QMP/README: Update QMP homepage address disable guest-provided stats on "info balloon" command QMP: Update README file QMP doc: Add 'Stability Considerations' section QMP/monitor: update do_info_version() to output broken down version string QMP: update 'query-version' documentation savevm: Reset last block info at beginning of each save set proper migration status on ->write error (v5) migration: Accept 'cont' only after successful incoming migration Update for v0.13.0-rc3 Update version for 0.13.0-rc2 Fix ivshmem build on 32-bit hosts hw/ivshmem.c don't check for negative values on unsigned data types Disable build of ivshmem on non-KVM systems ... Signed-off-by: Avi Kivity <avi@redhat.com>
| * | Merge commit 'a62e5f41204e71f375a5ba0f93f06b699003f694' into upstream-mergeAvi Kivity2010-10-1335-240/+1352
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a62e5f41204e71f375a5ba0f93f06b699003f694': (38 commits) vnc: check fd before calling qemu_set_fd_handler2() in vnc_client_write() disable guest-provided stats on "info balloon" command Revert "Make default invocation of block drivers safer (v3)" QEMUFileBuffered: indicate that we're ready when the underlying file is ready sparc escc IUS improvements (SunOS 4.1.4 fix) fix last cpu timer initialization QMP/README: Update QMP homepage address disable guest-provided stats on "info balloon" command QMP: Update README file QMP doc: Add 'Stability Considerations' section QMP/monitor: update do_info_version() to output broken down version string QMP: update 'query-version' documentation savevm: Reset last block info at beginning of each save set proper migration status on ->write error (v5) migration: Accept 'cont' only after successful incoming migration Update for v0.13.0-rc3 Update version for 0.13.0-rc2 Fix ivshmem build on 32-bit hosts hw/ivshmem.c don't check for negative values on unsigned data types Disable build of ivshmem on non-KVM systems ... Signed-off-by: Avi Kivity <avi@redhat.com>
| | * Merge remote branch 'qmp/for-stable-0.13' into stable-0.13Anthony Liguori2010-10-1110-36/+137
| | |\
| | | * QMP/README: Update QMP homepage addressLuiz Capitulino2010-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> (cherry picked from commit a18b2ce2ed9dc747c2ebab5a220517624e4ff3df)
| | | * disable guest-provided stats on "info balloon" commandEduardo Habkost2010-10-111-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The addition of memory stats reporting to the virtio balloon causes the 'info balloon' command to become asynchronous. This is a regression because in some cases it can hang the user monitor. This is an alternative to Adam Litke's patch. Adam's patch disabled the corresponding (guest-visible) virtio feature bit, causing issues for migration. Original discussion is available at: http://marc.info/?l=qemu-devel&m=128448124328314&w=2 Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Adam Litke <agl@us.ibm.com Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> (cherry picked from commit 07b0403dfc2b2ac179ae5b48105096cc2d03375a)
| | | * QMP: Update README fileLuiz Capitulino2010-10-111-23/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of changes I prefer to do in one shot: - Fix example - Small clarifications - Add multiple monitors example - Add 'Development Process' section Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit d29f3196afddd356a8169780fa506f565adb5036)
| | | * QMP doc: Add 'Stability Considerations' sectionLuiz Capitulino2010-10-111-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 05705ce2f8dfd8dcb5622b66ece21c9737a8502c)
| | | * QMP/monitor: update do_info_version() to output broken down version stringMiguel Di Ciurcio Filho2010-10-111-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code was originally developed by Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 0ec0291d67ccfcc8a488d24341ee138902510ea3)
| | | * QMP: update 'query-version' documentationMiguel Di Ciurcio Filho2010-10-111-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the documentation of 'query-version' to output the string version broken down. Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 6597e1a6dc2585c6e313b97fa750b7232dc904fd)
| | | * savevm: Reset last block info at beginning of each saveAlex Williamson2010-10-111-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we save more than once we need to reset the last block info or else only the first save has the actual block info and each subsequent save will only use continue flags, making them unloadable independently. Found-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 760e77eab53f5d92eb0c587e04fd942a905b46af)
| | | * set proper migration status on ->write error (v5)Marcelo Tosatti2010-10-112-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If ->write fails, declare migration status as MIG_STATE_ERROR. Also, in buffered_file.c, ->close the object in case of an error. Fixes "migrate -d "exec:dd of=file", where dd fails to open file. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit e447b1a603091cbaa5eed36c0a3c9ed3f2224535)
| | | * migration: Accept 'cont' only after successful incoming migrationAmit Shah2010-10-116-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a 'cont' is issued on a VM that's just waiting for an incoming migration, the VM reboots and boots into the guest, possibly corrupting its storage since it could be shared with another VM running elsewhere. Ensure that a VM started with '-incoming' is only run when an incoming migration successfully completes. A new qerror, QERR_MIGRATION_EXPECTED, is added to signal that 'cont' failed due to no incoming migration has been attempted yet. Reported-by: Laine Stump <laine@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 8e84865e54cb66fd7b57bb18c312ad3d56b6e276)
| | * | vnc: check fd before calling qemu_set_fd_handler2() in vnc_client_write()Yoshiaki Tamura2010-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting fd = -1 to qemu_set_fd_handler2() causes bus error at FD_SET in main_loop_wait(). Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit ac71103dc6b408775ae72067790ab367912f75ec)
| | * | disable guest-provided stats on "info balloon" commandEduardo Habkost2010-10-111-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The addition of memory stats reporting to the virtio balloon causes the 'info balloon' command to become asynchronous. This is a regression because in some cases it can hang the user monitor. This is an alternative to Adam Litke's patch. Adam's patch disabled the corresponding (guest-visible) virtio feature bit, causing issues for migration. Original discussion is available at: http://marc.info/?l=qemu-devel&m=128448124328314&w=2 Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Adam Litke <agl@us.ibm.com Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> (cherry picked from commit 07b0403dfc2b2ac179ae5b48105096cc2d03375a)
| | * | Revert "Make default invocation of block drivers safer (v3)"Anthony Liguori2010-10-113-135/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 79368c81bf8cf93864d7afc88b81b05d8f0a2c90. Conflicts: block.c I haven't been able to come up with a solution yet for the corruption caused by unaligned requests from the IDE disk so revert until a solution can be written. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 8b33d9eeba91422ee2d73b6936ad57262d18cf5a)
| | * | QEMUFileBuffered: indicate that we're ready when the underlying file is readyAvi Kivity2010-10-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QEMUFileBuffered stops writing when the underlying QEMUFile is not ready, and tells its producer so. However, when the underlying QEMUFile becomes ready, it neglects to pass that information along, resulting in stoppage of all data until the next tick (a tenths of a second). Usually this doesn't matter, because most QEMUFiles used with QEMUFileBuffered are almost always ready, but in the case of exec: migration this is not true, due to the small pipe buffers used to connect to the target process. The result is very slow migration. Fix by detecting the readiness notification and propagating it. The detection is a little ugly since QEMUFile overloads put_buffer() to send it, but that's the suject for a different patch. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 5e77aaa0d7d2f4ceaa4fcaf50f3a26d5150f34a6)
| | * | sparc escc IUS improvements (SunOS 4.1.4 fix)Artyom Tarasenko2010-10-111-26/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to scc_escc_um.pdf: - Reset Highest IUS must update irq status to allow processing of the next priority interrupt. - rx interrupt has always higher priority than tx on same channel The documentation only explicitly says that Reset Highest IUS command (0x38) clears IUS bits, not that it clears the corresponding interrupt too, so don't clear interrupts on this command. The patch allows SunOS 4.1.4 to use the serial ports Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> (cherry picked from commit 9fc391f8b54ea0be47baece3983e0f2224958f25)
| | * | fix last cpu timer initializationArtyom Tarasenko2010-10-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The timer #0 is the system timer, so the timer #num_cpu is the timer of the last CPU, and it must be initialized in slavio_timer_reset. Don't mark non-existing timers as running. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> (cherry picked from commit 5933e8a96ab9c59cb6b6c80c9db385364a68c959)
| | * | Update for v0.13.0-rc3Anthony Liguori2010-10-111-1/+1
| | |/ | | | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| | * Merge remote branch 'kwolf/for-stable-0.13' into stable-0.13Anthony Liguori2010-10-116-35/+105
| | |\
| | | * vvfat: Use cache=unsafeKevin Wolf2010-09-131-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qcow file used for write support in vvfat is a temporary file, so we can use cache=unsafe there. Without this, write support is just too slow to be of any use. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de> (cherry picked from commit 35ccd8aed64727dbefa1b274a8000b46318bfea1)
| | | * vvfat: Fix double free for opening the image rwKevin Wolf2010-09-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allocation and deallocation of bs->opaque is not in the control of a block driver. Therefore it should not set bs->opaque to a data structure used by another bs, or closing the image will lead to a double free. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de> (cherry picked from commit 0af1e52e93bf5da63b15f1f9596dd4c076da07dc)
| | | * vvfat: Fix segfault on write to read-only diskKevin Wolf2010-09-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vvfat tries to set the readonly flag in its open function, but nowadays this is overwritted with the readonly=... command line option. Check in bdrv_write if the vvfat was opened read-only and return an error in this case. Without this check, vvfat tries to access the qcow bs, which is NULL without enabled write support. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de> (cherry picked from commit bfd0049440f53745d31eb93c208f0f3ab6308027)
| | | * qcow2: Remove unnecessary flush after L2 writeKevin Wolf2010-09-131-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a new cluster was allocated, we only need a flush after the write to the L2 table if it was a COW and we need to decrease the refcounts of the old clusters. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 7ec5e6a4ca43494949465f9f9f3d9e4c7c620503)
| | | * block: Fix BDRV_O_CACHE_MASKKevin Wolf2010-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BDRV_O_CACHE_MASK should have been extended when cache=unsafe introduced a new flag BDRV_O_NO_FLUSH. There are currently no users that would change their behaviour because of this, but let's clean it up before things break. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit ceb25e5c7554255931f7f5647d3ad9df36111f53)
| | | * qemu-img convert: Use cache=unsafe for output imageKevin Wolf2010-09-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If qemu-img crashes during the conversion, the user will throw away the broken output file anyway and start over. So no need to be too cautious. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 1bd8e175580a87c7b9e6791faca7626f9bc3ceeb)
| | | * raw-posix: Don't use file name for host_cdrom detection on LinuxKevin Wolf2010-09-131-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Linux, we have code to detect CD-ROMs using an ioctl. We shouldn't lose anything but false positives by removing the check for a /dev/cd* path. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 897804d6299af372a43110799cbe1d6804d5e1bc)
| | | * scsi-disk: fix the check of the DBD bit in the MODE SENSE commandBernhard Kohl2010-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DBD bit does not work as expected. SCSI-Spec: http://ldkelley.com/SCSI2/SCSI2/SCSI2-08.html#8.2.10 "A disable block descriptors (DBD) bit of zero indicates that the target may return zero or more block descriptors in the returned MODE SENSE data (see 8.3.3), at the target's discretion. A DBD bit of one specifies that the target shall not return any block descriptors in the returned MODE SENSE data." Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 333d50fe3d9a1ff0a6a1a44ef42a0d3a2a7f2abe)
| | | * scsi-disk: return CHECK CONDITION for unknown page codes in the MODE SENSE ↵Bernhard Kohl2010-09-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | command SCSI-Spec: http://ldkelley.com/SCSI2/SCSI2/SCSI2-08.html#8.2.10 "An initiator may request any one or all of the supported mode pages from a target. If an initiator issues a MODE SENSE command with a page code value not implemented by the target, the target shall return CHECK CONDITION status and shall set the sense key to ILLEGAL REQUEST and the additional sense code to INVALID FIELD IN CDB." Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit a9c17b2bf3639662fbdeb736289ebabfda9fa21a)
| | | * scsi-disk: fix the block descriptor returned by the MODE SENSE commandBernhard Kohl2010-09-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The block descriptor contains the number of blocks, not the highest LBA. Real hard disks return 0 if the number of blocks exceed the maximum 0xFFFFFF. SCSI-Spec: http://ldkelley.com/SCSI2/SCSI2/SCSI2-08.html#8.3.3 "The number of blocks field specifies the number of logical blocks on the medium to which the density code and block length fields apply. A value of zero indicates that all of the remaining logical blocks of the logical unit shall have the medium characteristics specified." Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 2488b74081650a5312fe1515660b6cb095244c34)
| | | * scsi-disk: respect the page control (PC) field in the MODE SENSE commandBernhard Kohl2010-09-131-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The page control (PC) field defines the type of mode parameter values to be returned in the mode pages: PC=0 : Current values PC=1 : Changeable values PC=2 : Default values PC=3 : Saved values The current implementation always returns the same type of parameters. This is OK for Current and Default values as we don't support changes to be done by the MODE SELECT command. For Saved values the following applies (implemented by this patch): "A PC field value of 3h requests that the target return the saved values of the mode parameters. Implementation of saved page parameters is optional. Mode parameters not supported by the target shall be set to zero. If saved values are not implemented, the command shall be terminated with CHECK CONDITION status, the sense key set to ILLEGAL REQUEST and the additional sense code set to SAVING PARAMETERS NOT SUPPORTED." For Changeable values the following applies (implemented by this patch): "A PC field value of 1h requests that the target return a mask denoting those mode parameters that are changeable. In the mask, the fields of the mode parameters that are changeable shall be set to all one bits and the fields of the mode parameters that are non-changeable (i.e. defined by the target) shall be set to all zero bits." In newer versions of the SCSI-2 spec the following clause was added. "If the logical unit does not implement changeable parameters mode pages and the device server receives a MODE SENSE command with 01b in the PC field, then the command shall be terminated with CHECK CONDITION status, with the sense key set to ILLEGAL REQUEST, and the additional sense code set to INVALID FIELD IN CDB." This was not yet included in the SCSI-2 Working Drafts from 1986-1993. I assume that the variant to return CHECK CONDITION for PC=1 is not widely implemented by real devices. I have a legacy OS which fails, if MODE_SENSE returns non GOOD for PC=1. So for highest compatibility I implemented the former variant with this patch. The last Working Draft X3T9.2 Rev. 10L 7-SEP-93 can be found here: http://ldkelley.com/SCSI2/SCSI2/SCSI2-08.html#8.2.10 In mode_sense_page() this patch also avoids multiple hard coded definitions of the same mode page length. Instead I use the varable p[1]. In fact the returned length of the mode pages 4 and 5 were wrong (2 bytes less). Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 282ab04eb1e6f4faa6c5d2827e3209c4a1eec40e)
| | | * scsi-disk: fix the mode data header returned by the MODE SENSE(10) commandBernhard Kohl2010-09-131-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The header for the MODE SENSE(10) command is 8 bytes long. Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit ce512ee115b20bfc8a562d528a3f14eeff9ddf64)
| | | * scsi-disk: fix the mode data length field returned by the MODE SENSE commandBernhard Kohl2010-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MODE DATA LENGTH field indicates the length in bytes of the following data that is available to be transferred. The mode data length does not include the number of bytes in the MODE DATA LENGTH field. Signed-off-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 78e70c30612833fd0017cfa5b519bc23df808927)
| | * | Update version for 0.13.0-rc2Anthony Liguori2010-10-111-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>