aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-06-15monitor: Fix memory leak with readline completionStefan Weil1-0/+3
Each string which is shown during readline completion in the QEMU monitor is allocated dynamically but currently never deallocated. Add the missing loop which calls g_free for the allocated strings. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-06-15qmp: do not include monitor.h from qapi-types-core.hPaolo Bonzini1-3/+1
The comment is stale, monitor.h is not needed anymore (only qerror.h is, because it contains the schema for errors). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-06-15qmp: include monitor.h when neededPaolo Bonzini2-0/+2
This is needed to get file descriptors from SCM_RIGHTS. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-06-15kvm: add missing include filesPaolo Bonzini1-0/+2
These are included via monitor.h right now, add them explicitly. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-06-15qemu-iotests: add 036 autoclear feature bit testStefan Hajnoczi3-0/+121
This new test validates the autoclear feature bit behavior. When QEMU opens a qcow2v3 image file with an unknown autoclear feature bit the bit should be cleared in the image file header. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qemu-iotests: add qcow2.py set-feature-bit commandStefan Hajnoczi1-0/+23
This new command sets feature bits in the image file header: qcow2.py set-feature-bit incompatible|compatible|autoclear <bit> The bit number must be in the range [0, 64). Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15fdc-test: introduced qtest read_without_mediaPavel Hrdina1-0/+66
If you try to read from a floppy drive without a media, you should get an abnormal termination error. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15fdc: fix implied seek while there is no media in drivePavel Hrdina1-0/+4
The Windows uses 'READ' command at the start of an instalation without checking the 'dir' register. We have to abort the transfer with an abnormal termination if there is no media in the drive. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qcow2: fix autoclear image header updateStefan Hajnoczi1-8/+9
The autoclear feature bits can be used for qcow2 file format features that are safe to "drop" by old programs that do not understand the feature. Upon opening the image file unknown autoclear feature bits are cleared and the image file header is rewritten, but this was happening too early in the code when critical header fields were not yet loaded. Process autoclear feature bits after all necessary header information has been loaded. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15xen: Don't peek behind the BlockDriverState abstractionMarkus Armbruster2-5/+4
First offender is xen_config_dev_blk()'s use of disk->bdrv->filename. Get the filename from disk->opts instead. Same result, except for snapshots: there, we now get the filename specified by the user instead of the name of the temporary image created by bdrv_open(). Should be an improvement. Second offender is blk_init()'s use of blkdev->bs->drv->format_name. Simply use the appropriate interface to get the format name. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15xen: Don't change -drive if=xen device name during machine initMarkus Armbruster1-5/+4
A "top" BlockDriverState has a non-empty device_name. If the user doesn't specify one with -drive parameter id, the system supplies a default name. xen_config_dev_blk() changes this name, during machine initialization. Naughty. Don't do that. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15block: Replace bdrv_get_format() by bdrv_get_format_name()Markus Armbruster3-11/+7
So callers don't need to know anything about maximum name length. Returning a pointer is safe, because the name string lives as long as the block driver it names, and block drivers don't die. Requested by Peter Maydell. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qemu-img: document qed format on qemu-img man pageStefan Hajnoczi1-0/+23
The qemu-img.1 man page is missing the qed format from its list of supported formats. Document the image creation options for qed. Suggested-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qemu-iotests: COW with many AIO requests on the same clusterKevin Wolf3-0/+1043
This one is a bit more interesting. The COW operation isn't performed completely synchronously, and therefore dependencies must be handled correctly when multiple requests write to the same unallocated cluster. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-15qemu-iotests: Some backing file COW testsKevin Wolf3-0/+765
Looks like we're still missing these very basic tests for backing file handling. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-15qcow2: Fix avail_sectors in cluster allocation codeKevin Wolf1-1/+9
avail_sectors should really be the number of sectors from the start of the allocation, not from the start of the write request. We're lucky enough that this mistake didn't cause any real bug. avail_sectors is only used in the intialiser of QCowL2Meta: .nb_available = MIN(requested_sectors, avail_sectors), m->nb_available in turn is only used for COW at the end of the allocation. A COW occurs only if the request wasn't cluster aligned, which in turn would imply that requested_sectors was less than avail_sectors (both in the original and in the fixed version). In this case avail_sectors is ignored and therefore the mistake doesn't cause any misbehaviour. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qcow2: Simplify calculation for COW area at the endKevin Wolf1-3/+2
copy_sectors() always uses the sum (cluster_offset + n_start) or (start_sect + n_start), so if some value is added to both cluster_offset and start_sect, and subtracted from n_start, it's cancelled out anyway. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qcow2: always operate caches in writeback modePaolo Bonzini4-44/+5
Writethrough does not need special-casing anymore in the qcow2 caches. The block layer adds flushes after every guest-initiated data write, and these will also flush the qcow2 caches to the OS. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15ide: support enable/disable write cachePaolo Bonzini1-3/+18
Enabling or disabling the write cache is done with the SET FEATURES command. The command can be issued with sg_sat_set_features from sg3-utils. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15block: always open drivers in writeback modePaolo Bonzini1-1/+2
Formats are entirely in charge of flushes for metadata writes. For guest-initiated writes, a writethrough cache is faked in the block layer. So we can always open in writeback mode. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15block: add bdrv_set_enable_write_cachePaolo Bonzini2-0/+6
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15block: copy enable_write_cache in bdrv_appendPaolo Bonzini1-0/+2
Because the guest will be able to flip enable_write_cache, the actual state may not match what is used to open the new snapshot. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15savevm: flush after saving vm statePaolo Bonzini1-1/+1
Writing vm state uses bdrv_pwrite, so it will automatically get flushes in writethrough mode. But doing a flush at the end in writeback mode is probably a good idea anyway. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15block: flush in writethrough mode after writesPaolo Bonzini1-2/+9
We want to make the formats handle their own flushes autonomously, while keeping for guests the ability to use a writethrough cache. Since formats will write metadata via bs->file, bdrv_co_do_writev is the only place where we need to add a flush. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qemu-iotests: start vms in qtest modePaolo Bonzini2-2/+4
This way, they will not execute any VM code at all. However, right now the cancellation test is "relying" on being slowed down by TCG executing BIOS code. So, change the timeouts. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qemu-iotests: fill streaming test image with dataPaolo Bonzini1-1/+12
The TestStreamStop test case is racy; if the job completes before we can cancel it, it fails. If we remove the sleep the job will be canceled before it has even started, and the test succeeds but it is also not testing anything interesting. But if the image is left sparse, then the job has really nothing to do. For qcow2 it will read one L2-table, for raw it will issue a bunch of ioctls. This also falls under "not testing anything interesting", and this may be happening right now (depending on the filesystem) since the file protocol got an is_allocated method. Filling the test image with data ensures that the test covers the intended case. It also slows down the test, which will be particularly important after the next patch. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15scsi-disk: Don't peek behind the BlockDriverState abstractionMarkus Armbruster1-2/+1
Use the appropriate interface instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15block: New bdrv_get_flags()Markus Armbruster2-0/+6
Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15Prevent disk data loss when closing qemuPavel Dovgaluk1-1/+7
Prevent disk data loss when closing qemu console window under Windows 7. v3. Comment for Sleep() parameter was updated. Signed-off-by: Pavel Dovgalyuk<pavel.dovgaluk@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15block: Simplify how drive_init() computes default IDMarkus Armbruster1-5/+2
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15sheepdog: add coroutine_fn markers to coroutine functionsMORITA Kazutaka1-4/+5
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15rbd: hook up cache optionsJosh Durgin1-0/+19
Writeback caching was added in Ceph 0.46, and writethrough will be in 0.47. These are controlled by general config options, so there's no need to check for librbd version. Signed-off-by: Josh Durgin <josh.durgin@inktank.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qcow2: Support for fixing refcount inconsistenciesKevin Wolf3-15/+37
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qemu-img check: Print fixed clusters and recheckKevin Wolf3-0/+14
When any inconsistencies have been fixed, print the statistics and run another check to make sure everything is correct now. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qemu-img check -r for repairing imagesKevin Wolf9-14/+55
The QED block driver already provides the functionality to not only detect inconsistencies in images, but also fix them. However, this functionality cannot be manually invoked with qemu-img, but the check happens only automatically during bdrv_open(). This adds a -r switch to qemu-img check that allows manual invocation of an image repair. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15Un-inline fdctrl_init_isa()Markus Armbruster6-25/+26
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15xtensa_lx60: add missing #include "blockdev.h"Max Filippov1-0/+1
This should fix the following build failure: /home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c: In function 'lx_init': /home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: warning: implicit declaration of function 'drive_get' /home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: warning: nested extern declaration of 'drive_get' /home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: error: 'IF_PFLASH' undeclared (first use in this function) /home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: error: (Each undeclared identifier is reported only once /home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:212: error: for each function it appears in.) /home/buildbot/slave-public/block_mingw32/build/hw/xtensa_lx60.c:216: error: dereferencing pointer to incomplete type Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15stream: move rate limiting to a separate header filePaolo Bonzini2-29/+50
Make the code reusable. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15stream: move is_allocated_above to block.cPaolo Bonzini3-51/+55
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15stream: tweak usage of bdrv_co_is_allocatedPaolo Bonzini1-26/+25
is_allocated_base has complex semantics that are not really usable outside streaming. Split the check in two parts, where the allocated state for the top bs is moved to the caller. The resulting function is more generally useful. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15block: implement is_allocated for rawPaolo Bonzini2-0/+106
Either FIEMAP, or SEEK_DATA+SEEK_HOLE can be used to implement the is_allocated callback for raw files. On Linux ext4, btrfs and XFS all support it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qcow2: fix endianness conversionZhi Yong Wu1-1/+1
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15qcow2: remove a line of unnecessary codeZhi Yong Wu1-1/+0
Commit 3948d1d4 removed the pointer argument we filled in with l2_offset but forgot to remove the unnecessary l2_offset assignment. Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-06-15Merge branch 'master' of git://git.qemu.org/qemumalc4-10/+18
2012-06-15qcow2: Silence false warningKevin Wolf1-0/+2
Some gcc versions seem not to be able to figure out that the switch statement covers all possible values and that c is therefore always initialised. Add a default branch for them. Reported-by: malc <av1474@comtv.ru> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
2012-06-15cris: Fix NMI-flag handling on crisv10.Lars Persson4-10/+18
- The M-flag is encoded in different bits on cris v10 and cris v32. Signed-off-by: Lars Persson <larper@axis.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15xilinx_axidma: changed device namePeter A. G. Crosthwaite2-3/+3
Changed device name to xlnx,axi-dma. This is the exact name of the device in the Xilinx EDK development tools. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15xilinx_axienet: changed device namePeter A. G. Crosthwaite2-3/+3
Changed device name to xlnx,axi-ethernet. This is the exact name of the device in the xilinx EDK development tools. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15xilinx_axienet: droped the c_ on parametersPeter A. G. Crosthwaite2-4/+4
Even though the xilinx tools do have C_ on all params by default, drop this for consistency with all the other xilinx IP (I.E. param names are the xilinx names without the C_ prefix) Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-06-15xilinx_ethlite: changed device namePeter A. G. Crosthwaite2-4/+5
Changed device name to xlnx,xps-ethernetlite. This is the exact name of the device in the xilinx EDK development tools. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>