summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* qcow2: Fix corruption after error in update_refcountKevin Wolf2010-05-281-0/+4
| | | | | | | | | | After it is done with updating refcounts in the cache, update_refcount writes all changed entries to disk. If a refcount block allocation fails, however, there was no change yet and therefore first_index = last_index = -1. Don't treat -1 as a normal sector index (resulting in a 512 byte write!) but return without updating anything in this case. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: Fix corruption after refblock allocationKevin Wolf2010-05-281-2/+9
| | | | | | | | | | Refblock allocation code needs to take into consideration that update_refcount will load a different refcount block into the cache, so it must initialize the cache for a new refcount block only afterwards. Not doing this means that not only the refcount in the wrong block is updated, but also that the caller will work on the wrong block. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: Return right error code in write_refcount_block_entriesKevin Wolf2010-05-281-12/+15
| | | | | | | write_refcount_block_entries used to return -EIO for any errors. Change this to return the real error code. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: Change l2_load to return 0/-errnoKevin Wolf2010-05-281-16/+22
| | | | | | Provide the error code to the caller instead of just indicating success/error. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: Allow qcow2_get_cluster_offset to return errorsKevin Wolf2010-05-283-19/+37
| | | | | | | | | | | | | qcow2_get_cluster_offset() looks up a given virtual disk offset and returns the offset of the corresponding cluster in the image file. Errors (e.g. L2 table can't be read) are currenctly indicated by a return value of 0, which is unfortuately the same as for any unallocated cluster. So in effect we can't check for errors. This makes the old return value a by-reference parameter and returns the usual 0/-errno error code. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block.h: Make BDRV_SECTOR_SIZE 64 bit safeJes Sorensen2010-05-281-1/+1
| | | | | | | | C defaults to int, so make definition of BDRV_SECTOR_SIZE 64 bit safe as it and BDRV_SECTOR_MASK may be used against 64 bit addresses. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* posix-aio-compat: Expand tabs that have crept inStefan Hajnoczi2010-05-281-29/+29
| | | | | | | | This patch expands tabs on a few lines so the code formats nicely and follows the QEMU coding style. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* drive: allow rerror, werror and readonly for if=noneGerd Hoffmann2010-05-281-3/+3
| | | | | | | | | | | | | | When creating guest disks the qdev way using ... -drive if=none,id=$name,args -device $driver,drive=$name it is not possible to specify rerror, werror and readonly arguments for drive as drive_init allows/blocks them based on the interface (if=) specified and none isn't white-listed there. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* add support for protocol driver create_optionsMORITA Kazutaka2010-05-285-26/+86
| | | | | | | | | This patch enables protocol drivers to use their create options which are not supported by the format. For example, protcol drivers can use a backing_file option with raw format. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-io: Add multiwrite commandKevin Wolf2010-05-281-0/+192
| | | | | | | The new multiwrite commands allows to use qemu-io for testing bdrv_aio_multiwrite. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Fix multiwrite with overlapping requestsKevin Wolf2010-05-281-1/+1
| | | | | | | With overlapping requests, the total number of sectors is smaller than the sum of the nb_sectors of both requests. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: Fix error handling in l2_allocateKevin Wolf2010-05-281-10/+13
| | | | | | | | | | l2_allocate has some intermediate states in which the image is inconsistent. Change the order to write to the L1 table only after the new L2 table has successfully been initialized. Also reset the L2 cache in failure case, it's very likely wrong. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: Clear L2 table cache after write errorKevin Wolf2010-05-281-0/+1
| | | | | | | | If the L2 table was already updated in cache, but writing it to disk has failed, we must not continue using the changed version in the cache to stay consistent with what's on the disk. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* vhost_net.c: v2 Fix build failure introduced by ↵Jes Sorensen2010-05-271-1/+1
| | | | | | | | | | | | 0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2 Fix build failure introduced by 0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2 The format statement expects unsigned long on x86_64, but receives unsigned long long, so gcc exits with an error. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Make cache=unsafe the default for -snapshotAlexander Graf2010-05-272-5/+5
| | | | | | | | | When using -snapshot we don't care about data integrity of the cow file at all, so let's disable flushing there and squeeze out the last drop of performance we could possibly get. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* sparc64: clean up pci bridge mapIgor V. Kovalenko2010-05-262-25/+28
| | | | | | | | | | - remove unused host state and store pci bus pointer only - do not map host state access into unused 1fe.10000000 range - reorder pci region registration - assign pci i/o region to isa_mem_base Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sparc64: rename sun4u cpu to Ultrasparc IIiIgor V. Kovalenko2010-05-261-1/+1
| | | | | Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Add cache=unsafe parameter to -driveAlexander Graf2010-05-265-4/+44
| | | | | | | | | | | | | | | Usually the guest can tell the host to flush data to disk. In some cases we don't want to flush though, but try to keep everything in cache. So let's add a new cache value to -drive that allows us to set the cache policy to most aggressive, disabling flushes. We call this mode "unsafe", as guest data is not guaranteed to survive host crashes anymore. This patch also adds a noop function for aio, so we can do nothing in AIO fashion. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* vnc: rich cursor support.Gerd Hoffmann2010-05-243-12/+73
| | | | | | | | | Uses VNC_ENCODING_RICH_CURSOR. Adding XCURSOR support should be possible without much trouble. Shouldn't be needed though as RICH_CURSOR is a superset of XCURSOR. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* use new cursor struct + functions for vmware vga and sdl.Gerd Hoffmann2010-05-242-44/+48
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* cursor: add cursor functions.Gerd Hoffmann2010-05-245-3/+310
| | | | | | | | Add a new cursor type to console.h and a bunch of functions to deal with cursors the (new) cursor.c file. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Fix error handling in qemu_read_config_fileKevin Wolf2010-05-242-6/+10
| | | | | | | | | | We need to close the file even in error case. While at it, make the callers catch all kind of errors. ENOENT is allowed for default config files, they are optional. Reported-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Virtio-net: Replace the hardcode 6 with defined ETN_ALENAmos Kong2010-05-241-2/+2
| | | | | | | | | hw/virtio-net.h: #define ETH_ALEN 6 ETH_ALEN was defined by commit 7967406801aa897fae83caad3278ac85a342adaa Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* sdl: Do not disable screensaver by defaultJan Kiszka2010-05-241-0/+4
| | | | | | | | | | Unless we are running in full-screen mode, QEMU's SDL window should not disable the host's screensaver. The user can still change this behaviour by setting the environment variable SDL_VIDEO_ALLOW_SCREENSAVER as desired. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote branch 'kwolf/for-anthony' into stagingAnthony Liguori2010-05-244-8/+48
|\
| * vvfat: More build fixes with DEBUGKevin Wolf2010-05-211-2/+6
| | | | | | | | | | | | | | Casting a pointer to an int doesn't work on 64 bit platforms. Use the %p printf conversion specifier instead. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * vvfat: Fix compilation with DEBUG definedRiccardo Magliocchetti2010-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | gcc does not like passing a NULL where an int value is expected: block/vvfat.c: In function ‘checkpoint’: block/vvfat.c:2868: error: passing argument 2 of ‘remove_mapping’ makes integer from pointer without a cast Signed-off-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * block: Add SG_IO device check in refresh_total_sectors()Nicholas Bellinger2010-05-211-0/+4
| | | | | | | | | | | | | | | | | | | | This patch adds a special case check for scsi-generic devices in refresh_total_sectors() to skip the subsequent BlockDriver->bdrv_getlength() that will be returning -ESPIPE from block/raw-posic.c:raw_getlength() for BlockDriverState->sg=1 devices. Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * block: Make find_image_format() return 'raw' BlockDriver for SG_IO devicesNicholas Bellinger2010-05-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds a special BlockDriverState->sg check in block.c:find_image_format() after bdrv_file_open() -> block/raw-posix.c:hdev_open() has been called to determine if we are dealing with a Linux host scsi-generic device. The patch then returns the BlockDriver * from bdrv_find_format("raw"), skipping the subsequent bdrv_read() and rest of find_image_format(). Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * block: fix sector comparism in multiwrite_req_compareChristoph Hellwig2010-05-211-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The difference between the start sectors of two requests can be larger than the size of the "int" type, which can lead to a not correctly sorted multiwrite array and thus spurious I/O errors and filesystem corruption due to incorrect request merges. So instead of doing the cute sector arithmetics trick spell out the exact comparisms. Spotted by Kevin Wolf based on a testcase from Michael Tokarev. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * virtio-blk: fix barrier supportChristoph Hellwig2010-05-211-2/+13
| | | | | | | | | | | | | | | | Before issuing the barrier to the block driver we need to flush our oustanding queue of write requests, as the flush is supposed to be issued after them. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * virtio-blk: Avoid zeroing every request structureStefan Hajnoczi2010-05-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The VirtIOBlockRequest structure is about 40 KB in size. This patch avoids zeroing every request by only initializing fields that are read. The other fields are either written to or may not be used at all. Oprofile shows about 10% of CPU samples in memset called by virtio_blk_alloc_request(). The workload is dd if=/dev/vda of=/dev/null iflag=direct bs=8k running concurrently 4 times. This patch makes memset disappear to the bottom of the profile. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * block: fix aio_flush segfaults for read-only protocols (e.g. curl)Avi Kivity2010-05-211-1/+3
| | | | | | | | | | | | | | | | | | | | Not all block format drivers expose an io_flush method (reasonable for read-only protocols), so calling io_flush there will immediately segfault. Fix by checking for the method's existence before calling it. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | Merge remote branch 'qmp/for-anthony' into stagingAnthony Liguori2010-05-2425-117/+143
|\ \
| * | Fix qtypes' licensesLuiz Capitulino2010-05-1919-44/+73
| | | | | | | | | | | | | | | | | | | | | | | | - Change from GPL to LGPL - Add license text when missing - Minor cosmetic changes to make all headers look the same Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * | Monitor: Return before exiting with 'quit'Luiz Capitulino2010-05-191-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a new version of the (now reverted) following commit: 0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d The 'quit' Monitor command (implemented by do_quit()) calls exit() directly, this is problematic under QMP because QEMU exits before having a chance to send the ok response. Clients don't know if QEMU exited because of a problem or because the 'quit' command has been executed. This commit fixes that by making do_quit() use qemu_system_shutdown_request(), so that we exit gracefully. Thanks to Paolo Bonzini <pbonzini@redhat.com> for suggesting this solution. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * | sysemu: Export 'no_shutdown'Luiz Capitulino2010-05-191-0/+1
| | | | | | | | | | | | | | | | | | It's a global variable already, do_quit() will use it. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * | Revert "Monitor: Return before exiting with 'quit'"Luiz Capitulino2010-05-193-22/+1
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0e8d2b5575938b8876a3c4bb66ee13c5d306fb6d. Next commits will do the same thing in a better way. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
| * | Revert "monitor: Convert do_pci_device_hot_remove() to QObject"Markus Armbruster2010-05-193-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't want pci_del in QMP. Use device_del instead. This reverts commit 6848d827162fea039f2658414a4adb6164a4f9b0. Conflicts: hw/pci-hotplug.c sysemu.h Signed-off-by: Markus Armbruster <armbru@redhat.com>
| * | Revert "PCI: Convert pci_device_hot_add() to QObject"Markus Armbruster2010-05-193-45/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Short story: We don't want pci_add in QMP. Long story follows. pci_add can do two things: * Hot plug a PCI NIC. device_add is more general. * Hot plug a PCI disk controller, and a drive connected to it. The controller is either virtio-blk-pci (if=virtio) or lsi53c895a (if=scsi). With the latter, the drive is optional. Use drive_add to hotplug additional SCSI drives. Except drive_add is not available in QMP. device_add is more general for controllers and the guest part of drives. I'm working on a more general alternative for the host part of drives. Why am I proposing to remove pci_add from QMP before its replacement is ready? I want it out sooner rather than later, because it isn't fully functional (errors and drive_add are missing), and we do not plan to complete the job. In other words, it's not really usable over QMP now, and it's not what we want for QMP anyway. Since we don't want it to be used over QMP, we should take it out, not leave it around as a trap for the uninitiated. Dan Berrange confirmed that libvirt has no need for pci_add & friends over QMP. This reverts commit 7a344f7ac7bb651d0556a933ed8060d3a9e5d949. Conflicts: hw/pci-hotplug.c sysemu.h Signed-off-by: Markus Armbruster <armbru@redhat.com>
| * | QMP: Add "Downstream extension of QMP" to specMarkus Armbruster2010-05-191-0/+55
| | | | | | | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com>
* | | microblaze: Handle new elf mach nr for sysemu.Edgar E. Iglesias2010-05-241-0/+5
| | | | | | | | | | | | Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
* | | lsi: Fix value overflow in request tag processingJan Kiszka2010-05-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a mismerge of 64d564094cac5f72eeaeb950c442b773a00d3586 (wrong patch version): We need to mask the tag value properly to obtain its device ID. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | | sparc64: flush translations on mmu context changeIgor V. Kovalenko2010-05-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | - two pairs of softmmu indexes bind softmmu tlb to cpu tlb in fault handlers using value of DMMU primary and secondary context registers, so we need to flush softmmu translations when context registers are changed Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | sparc64: fix mmu context at trap levels above zeroIgor V. Kovalenko2010-05-223-8/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - cpu_mmu_index return MMU_NUCLEUS_IDX if trap level is not zero - cpu_get_tb_cpu_state: store trap level and primary context in flags this allows to restart code translation when address translation is changed - stop translation block after writing to pstate and tl registers - stop translation block after writing to alternate space this can be optimized to stop only if address translation can be changed by write operation (e.g. by comparing with MMU ASI values) Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | sparc64: fix dump_mmu to look for global bit in tte value instead of tagIgor V. Kovalenko2010-05-221-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | sparc64: fix pstate privilege bitsIgor V. Kovalenko2010-05-224-36/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - refactor code to handle hpstate only if available for current cpu - conditionally set hypervisor bit in hpstate register - reorder softmmu indices so user accessable ones go first, translation context macros supervisor() and hypervisor() adjusted as well - disable sparcv8 registers for TARGET_SPARC64 - fix cpu_mmu_index to use sparcv9 bits only Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | sparc64: generate data access exception on RW violationIgor V. Kovalenko2010-05-221-37/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - separate PRIV and PROT handling - DPRINTF_MMU macro to clean up debug code - dump mmu_idx, trap level and mmu context registers along with address translation values Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | sparc32 protect read-only bits in DMA CSR registersArtyom Tarasenko2010-05-221-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On a real hardware changing read-only bits has no effect Use a mask common for SCSI and Ethernet registers. The crucial bit is DMA_INTR, because setting or clearing it may produce spurious interrupts. This patch allows booting Solaris 2.3 Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | | vmstate: fix breakage by 7e72abc382b700a72549e8147bdea413534eeedcTeLeMan2010-05-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | cirrus_post_load() will be executed twice when loading vm states and then the wrong physical memory will be registered. This issue may lead to crash qemu. Signed-off-by: TeLeMan <geleman@gmail.com> Acked-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
OpenPOWER on IntegriCloud