summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-11-12vhost: rename RESET_DEVICE backto RESET_OWNERYuanhan Liu6-12/+12
This patch basically reverts commit d1f8b30e. It turned out that it breaks stuff, so revert it: http://lists.nongnu.org/archive/html/qemu-devel/2015-10/msg00949.html CC: "Michael S. Tsirkin" <mst@redhat.com> Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-12vhost-user: modify SET_LOG_BASE to pass mmap size and offsetVictor Kaplansky3-3/+24
Unlike the kernel, vhost-user application accesses log table by mmaping it to its user space. This change adds two new fields to VhostUserMsg payload: mmap_size, and mmap_offset and make QEMU to pass the to vhost-user application in VHOST_USER_SET_LOG_BASE request. Signed-off-by: Victor Kaplansky <victork@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-12virtio-pci: unbreak queue_enable readJason Wang1-0/+7
Guest always get zero when reading queue_enable. This violates spec. Fixing this by setting the queue_enable to true during any guest writing and setting it to zero during reset. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-12virtio-pci: introduce pio notification capability for modern deviceJason Wang2-17/+113
We used to use mmio for notification. This could be slow on some arch (e.g on x86 without EPT). So this patch introduces pio bar and a pio notification cap for modern device. This ability is enabled through property "modern-pio-notify" for virtio pci devices and was disabled by default. Management can enable when it thinks it was needed. Benchmarks shows almost no obvious difference compared to legacy device on machines without ept. Thanks Wenli Quan <wquan@redhat.com> for the benchmarking. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-12virtio-pci: use zero length mmio eventfd for 1.0 notification cap when possibleJason Wang1-4/+15
We use data match eventfd for 1.0 notification currently. This could be slow since software decoding is needed for mmio exit. To speed this up, we can switch to use zero length mmio eventfd for 1.0 notification since we can examine the queue index directly from the writing address. KVM kernel module can utilize this by registering it to fast mmio bus which could be as fast as pio on ept capable machine when fast mmio is supported by host kernel. Lots of improvements were seen on a ept capable machine: Guest RX:(TCP) size/session/+throughput%/+cpu%/-+per cpu%/ 64/1/+1.6807%/[-16.2421%]/[+21.3984%]/ 64/2/+0.6091%/[-11.0187%]/[+13.0678%]/ 64/4/+0.0553%/[-5.9768%]/[+6.4155%]/ 64/8/+0.1206%/[-4.0057%]/[+4.2984%]/ 256/1/-0.0031%/[-10.1166%]/[+11.2517%]/ 256/2/-0.5058%/[-6.1656%]/+6.0317%]/ ... Guest TX:(TCP) size/session/+throughput%/+cpu%/-+per cpu%/ 64/1/[+18.9183%]/-0.2823%/[+19.2550%]/ 64/2/[+13.5714%]/[+2.2675%]/[+11.0533%]/ 64/4/[+13.1070%]/[+2.1817%]/[+10.6920%]/ 64/8/[+13.0426%]/[+2.0887%]/[+10.7299%]/ 256/1/[+36.2761%]/+6.3434%/[+28.1471%]/ ... 1024/1/[+44.8873%]/+2.0811%/[+41.9335%]/ ... 1024/4/+0.0228%/[-2.2044%]/[+2.2774%]/ ... 16384/2/+0.0127%/[-5.0346%]/[+5.3148%]/ ... 65535/1/[+0.0062%]/[-4.1183%]/[+4.3017%]/ 65535/2/+0.0004%/[-4.2311%]/[+4.4185%]/ 65535/4/+0.0107%/[-4.6106%]/[+4.8446%]/ 65535/8/-0.0090%/[-5.5178%]/[+5.8306%]/ Latency:(TCP_RR) size/session/+transaction rate%/+cpu%/-+per cpu%/ 64/1/[+6.5248%]/[-9.2882%]/[+17.4322%]/ 64/25/[+11.0854%]/[+0.8000%]/[+10.2038%]/ 64/50/[+12.1076%]/[+2.4627%]/[+9.4131%]/ 256/1/[+5.3677%]/[+10.5669%]/-4.7024%/ 256/25/[+5.6402%]/-0.8962%/[+6.5955%]/ 256/50/[+5.9685%]/[+1.7766%]/[+4.1188%]/ 4096/1/+0.2508%/[-10.4941%]/[+12.0047%]/ 4096/25/[+1.8533%]/-0.0273%/+1.8812%/ 4096/50/[+1.2156%]/-1.4134%/+2.6667%/ Notes: data with '[]' is the one whose significance is greater than 95%. Thanks Wenli Quan <wquan@redhat.com> for the benchmarking. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-12KVM: add support for any length io eventfdJason Wang3-0/+13
Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
2015-11-12memory: don't try to adjust endianness for zero length eventfdJason Wang1-2/+6
There's no need to adjust endianness for zero length eventfd since the data wrote was actually ignored by kernel. So skip the adjust in this case to fix a possible crash when trying to use wildcard mmio eventfd in ppc. Cc: Greg Kurz <gkurz@linux.vnet.ibm.com> Cc: Peter Maydell <peter.maydell@linaro.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2015-11-12virtio-pci: fix 1.0 virtqueue migrationJason Wang5-7/+207
We don't migrate the followings fields for virtio-pci: uint32_t dfselect; uint32_t gfselect; uint32_t guest_features[2]; struct { uint16_t num; bool enabled; uint32_t desc[2]; uint32_t avail[2]; uint32_t used[2]; } vqs[VIRTIO_QUEUE_MAX]; This will confuse driver if migrating during initialization. Solves this issue by: - introduce transport specific callbacks to load and store extra virtqueue states. - add a new subsection for virtio to migrate transport specific modern device state. - implement pci specific callbacks. - add a new property for virtio-pci for whether or not to migrate extra state. - compat the migration for 2.4 and elder machine types Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-12Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2015-11-11-tag' ↵Peter Maydell1-14/+15
into staging qemu-ga patch queue * fix for unintended overwriting of data on w32 using guest-file-open with append mode # gpg: Signature made Wed 11 Nov 2015 22:14:52 GMT using RSA key ID F108B584 # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" # gpg: aka "Michael Roth <mdroth@utexas.edu>" # gpg: aka "Michael Roth <mdroth@linux.vnet.ibm.com>" * remotes/mdroth/tags/qga-pull-2015-11-11-tag: qga: fix append file open modes for win32 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-12tests: classify some ivshmem tests as slowMarc-André Lureau1-2/+4
Some tests may take long to run, move them under g_test_slow() condition. The 5s timeout for the "server" test will have to be adjusted to the worst known time (for the records, it takes ~0.2s on my host). The "pair" test takes ~1.7, a quickest version could be implemented. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 1447326618-11686-1-git-send-email-marcandre.lureau@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-12Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-11-11' ↵Peter Maydell6-30/+21
into staging error: More error_setg() usage # gpg: Signature made Wed 11 Nov 2015 17:57:15 GMT using RSA key ID EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" * remotes/armbru/tags/pull-error-2015-11-11: error: More error_setg() usage Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-11Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into stagingPeter Maydell1-53/+33
# gpg: Signature made Wed 11 Nov 2015 17:59:33 GMT using RSA key ID C0DE3057 # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>" # gpg: aka "Jeffrey Cody <jeff@codyprime.org>" # gpg: aka "Jeffrey Cody <codyprime@gmail.com>" * remotes/cody/tags/block-pull-request: gluster: allocate GlusterAIOCBs on the stack Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-11Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20151111' into stagingPeter Maydell15-77/+506
Hopefully last big batch of s390x patches, including: - bugfixes for LE host and for pci translation - MAINTAINERS update - hugetlbfs enablement (kernel patches pending) - boot from El Torito iso images on virtio-blk (boot from scsi pending) - cleanup in the ipl device code There's also a helper function for resetting busless devices in the qdev core in there. # gpg: Signature made Wed 11 Nov 2015 17:49:58 GMT using RSA key ID C6F02FAF # gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" * remotes/cohuck/tags/s390x-20151111: s390: deprecate the non-ccw machine in 2.5 s390x/ipl: switch error reporting to error_setg s390x/ipl: clean up qom definitions and turn into TYPE_DEVICE qdev: provide qdev_reset_all_fn() pc-bios/s390-ccw: rebuild image pc-bios/s390-ccw: El Torito 16-bit boot image size field workaround pc-bios/s390-ccw: El Torito s390x boot entry check pc-bios/s390-ccw: ISO-9660 El Torito boot implementation pc-bios/s390-ccw: Always adjust virtio sector count s390x/kvm: don't enable CMMA when hugetlbfs will be used s390x: switch to memory_region_allocate_system_memory MAINTAINERS: update virtio-ccw/s390 git tree MAINTAINERS: update s390 file patterns s390x/pci : fix up s390 pci iommu translation function s390x/css: sense data endianness Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-11error: More error_setg() usageEric Blake6-30/+21
A few uses of error_set(ERROR_CLASS_GENERIC_ERROR) were missed in c6bd8c706, or have snuck in since. Nuke them. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1447224690-9743-19-git-send-email-eblake@redhat.com> Acked-by: Andreas Färber <afaerber@suse.de> [Indentation tidied up, commit message tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-11-11Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell38-311/+2626
Block layer patches # gpg: Signature made Wed 11 Nov 2015 16:03:19 GMT using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: (41 commits) iotests: Check for quorum support in test 139 qcow2: Fix qcow2_get_cluster_offset() for zero clusters iotests: Add tests for the x-blockdev-del command block: Add 'x-blockdev-del' QMP command block: Add blk_get_refcnt() mirror: block all operations on the target image during the job qemu-iotests: fix -valgrind option for check qemu-iotests: fix cleanup of background processes qemu-io: Correct error messages qemu-io: Check for trailing chars qemu-io: fix cvtnum lval types block: test 'blockdev-snapshot' using a file BDS as the overlay block: Remove inner quotation marks in iotest 085 block: Disallow snapshots if the overlay doesn't support backing files throttle: Use bs->throttle_state instead of bs->io_limits_enabled throttle: Check for pending requests in throttle_group_unregister_bs() qemu-img: add check for zero-length job len qcow2: avoid misaligned 64bit bswap qemu-iotests: Test the reopening of overlay_bs in 'block-commit' commit: reopen overlay_bs before base ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-11-11s390: deprecate the non-ccw machine in 2.5Christian Borntraeger1-1/+5
The non-ccw machine for s390 (s390-virtio) is not very well maintained and caused several issues in the past: - aliases like virtio-blk did not work for s390 - virtio refactoring failed due to long standing bugs (e.g.see commit cb927b8a "s390-virtio: Accommodate guests using virtqueues too early") - some features like memory hotplug will cause trouble due to virtio storage being above guest memory - the boot loader bios no longer seems to work. the source code of that loader is also no longer maintained 2.4 changed the default to the ccw machine, let's deprecate the old machine for 2.5. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Message-Id: <1446811645-25565-1-git-send-email-borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11s390x/ipl: switch error reporting to error_setgDavid Hildenbrand1-7/+11
Now that we can report errors in the realize function, let's replace the fprintf's and hw_error's with error_setg. Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11s390x/ipl: clean up qom definitions and turn into TYPE_DEVICEDavid Hildenbrand3-51/+36
Let's move the qom definitions of the ipl device into ipl.h, replace "s390-ipl" by a proper type define, turn it into a TYPE_DEVICE and remove the unneeded class definition. Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11qdev: provide qdev_reset_all_fn()David Hildenbrand2-0/+6
For TYPE_DEVICE, the dc->reset() function is not called on system resets yet. Until that is changed, we have to manually register a reset handler. Let's provide qdev_reset_all_fn(), that can directly be used - just like the reset handler that is already available for qbus. Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11pc-bios/s390-ccw: rebuild imageCornelia Huck1-0/+0
Contains: pc-bios/s390-ccw: Always adjust virtio sector count pc-bios/s390-ccw: ISO-9660 El Torito boot implementation pc-bios/s390-ccw: El Torito s390x boot entry check pc-bios/s390-ccw: El Torito 16-bit boot image size field workaround Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11pc-bios/s390-ccw: El Torito 16-bit boot image size field workaroundMaxim Samoylov2-0/+97
Because of El Torito spec flaw boot image size needs to be verified. Boot catalog entry size field has 16-bit width, and specifies size in 512-byte units. Thus, boot image size cannot exceed 32M. We actually search for the file to get the file size. This is done by scanning the ISO directory tree for the ISO block number and reading the file size from the directory entry. Signed-off-by: Maxim Samoylov <max7255@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11pc-bios/s390-ccw: El Torito s390x boot entry checkMaxim Samoylov2-1/+18
Boot entry is considered compatible if boot image is Linux kernel with matching S390 Linux magic string. Empty boot images with sector_count == 0 are considered broken. Signed-off-by: Maxim Samoylov <max7255@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11pc-bios/s390-ccw: ISO-9660 El Torito boot implementationMaxim Samoylov4-0/+306
This patch enables boot from media formatted according to ISO-9660 and El Torito bootable CD specification. We try to boot from device as ISO-9660 media when SCSI IPL failed. The first boot catalog entry with bootable flag is used. ISO-9660 media with default 2048-bytes sector size only is supported. Signed-off-by: Maxim Samoylov <max7255@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11pc-bios/s390-ccw: Always adjust virtio sector countMaxim Samoylov1-6/+1
Let's always adjust the sector number to be read using the current virtio block size value. This prepares for the implementation of IPL from ISO-9660 media. Signed-off-by: Maxim Samoylov <max7255@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11s390x/kvm: don't enable CMMA when hugetlbfs will be usedDominik Dingel1-1/+3
On hugetlbfs CMMA will not be useful as every ESSA instruction will trap. So don't offer CMMA to guests with a hugepages backing. Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11s390x: switch to memory_region_allocate_system_memoryDominik Dingel1-2/+1
By replacing memory_region_init_ram with memory_region_allocate_system_memory we gain goodies like mem-path backends. This will allow us to use hugetlbfs once the kernel supports it. Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11MAINTAINERS: update virtio-ccw/s390 git treeCornelia Huck1-2/+6
Let's reference the git branch I actually use, and add Christian's git tree. Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11MAINTAINERS: update s390 file patternsCornelia Huck1-6/+6
We were missing some files, and some files should get an additional entry to add the people actually looking after the code. Reported-by: Thomas Huth <thuth@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11s390x/pci : fix up s390 pci iommu translation functionYi Min Zhao1-2/+6
On s390x, each pci device has its own iommu, which is only properly setup in qemu once the mpcifc instruction used to register the translation table has been intercepted. Therefore, for a pci device that is not configured or has not been initialized, proper translation is neither required nor possible. Moreover, we may not have a host bridge device ready yet. This was exposed by a recent vfio change that triggers iommu translation during the initialization of the vfio pci device. Let's do an early exit in that case. Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2015-11-11s390x/css: sense data endiannessCornelia Huck1-0/+6
We keep the device's sense data in a byte array (following the architecture), but the ecws are an array of 32 bit values. If we just blindly copy the values, the sense data will change from de-facto BE data to de-facto cpu-endian data, which means we end up doing an incorrect conversion on LE hosts. Let's just explicitly convert to cpu-endianness while assembling the irb. Reported-by: Andy Lutomirski <luto@kernel.org> Tested-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
2015-11-11qga: fix append file open modes for win32Kirk Allan1-14/+15
For append file open modes, use FILE_APPEND_DATA for the desired access for writing at the end of the file. Version 2: For "a+", "ab+", and "a+b" modes use FILE_APPEND_DATA|GENERIC_READ. ORing in GENERIC_READ starts a read at the begining of the file. All writes will append to the end fo the file. Added white space to maintain the alignment of the guest_file_open_modes[]. Signed-off-by: Kirk Allan <kallan@suse.com> Cc: qemu-stable@nongnu.org * use FILE_GENERIC_APPEND macro, which provides same semantics as FILE_APPEND_DATA, but retains other flags from GENERIC_WRITE Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2015-11-11Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2015-11-11' ↵Kevin Wolf18-51/+692
into queue-block Block patches from 2015-10-26 until 2015-11-11. # gpg: Signature made Wed Nov 11 17:00:50 2015 CET using RSA key ID E838ACAD # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" * mreitz/tags/pull-block-for-kevin-2015-11-11: iotests: Check for quorum support in test 139 qcow2: Fix qcow2_get_cluster_offset() for zero clusters iotests: Add tests for the x-blockdev-del command block: Add 'x-blockdev-del' QMP command block: Add blk_get_refcnt() mirror: block all operations on the target image during the job qemu-iotests: fix -valgrind option for check qemu-iotests: fix cleanup of background processes Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-11iotests: Check for quorum support in test 139Alberto Garcia1-0/+2
The quorum driver is always built in, but it is disabled during run-time if there's no SHA256 support available (see commit e94867e). This patch skips the quorum test in iotest 139 in that case. Signed-off-by: Alberto Garcia <berto@igalia.com> Message-id: 1447172891-20410-1-git-send-email-berto@igalia.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-11-11qcow2: Fix qcow2_get_cluster_offset() for zero clustersKevin Wolf1-6/+9
When searching for contiguous zero clusters, we only need to check the cluster type. Before this patch, an increasing offset (L2E_OFFSET_MASK) was expected, so that the function never returned more than a single zero cluster in practice. This patch fixes it to actually return as many contiguous zero clusters as it can. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-id: 1446657384-5907-1-git-send-email-kwolf@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-11-11iotests: Add tests for the x-blockdev-del commandAlberto Garcia3-0/+420
Signed-off-by: Alberto Garcia <berto@igalia.com> Message-id: 57c3b0d4d0c73ddadd19e5bded9492c359cc4568.1446475331.git.berto@igalia.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-11-11block: Add 'x-blockdev-del' QMP commandAlberto Garcia3-4/+155
This command is still experimental, hence the name. This is the companion to 'blockdev-add'. It allows deleting a BlockBackend with its associated BlockDriverState tree, or a BlockDriverState that is not attached to any backend. In either case, the command fails if the reference count is greater than 1 or the BlockDriverState has any parents. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 6cfc148c77aca1da942b094d811bfa3fcf7ac7bb.1446475331.git.berto@igalia.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-11-11block: Add blk_get_refcnt()Alberto Garcia2-0/+6
This function returns the reference count of a given BlockBackend. For convenience, it returns 0 if the BlockBackend pointer is NULL. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: dfdd8a17dbe3288842840636d2cfe5bb895abcb0.1446475331.git.berto@igalia.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-11-11mirror: block all operations on the target image during the jobAlberto Garcia1-0/+4
There's nothing preventing the target image from being used by other operations during the 'drive-mirror' job, so we should block them all until the job is done. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 82b88fd04cde918a08a6f9a4ab85626d7fd7b502.1446475331.git.berto@igalia.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-11-11qemu-iotests: fix -valgrind option for checkJeff Cody6-26/+59
Commit 934659c switched the iotests to run qemu-io from a bash subshell, in order to catch segfaults. This method is incompatible with the current valgrind_qemu_io() bash function. Move the valgrind usage into the exec subshell in _qemu_io_wrapper(), while making sure the original return value is passed back to the caller. Update test output for tests 039, 061, and 137 as it looks for the specific subshell command when the process is terminated. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Message-id: 0066fd85d26ca641a1c25135ff2479b7985701cf.1446232490.git.jcody@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-11-11qemu-iotests: fix cleanup of background processesJeff Cody4-15/+37
Commit 934659c switched the iotests to run qemu and qemu-nbd from a bash subshell, in order to catch segfaults. Unfortunately, this means the process PID cannot be captured via '$!'. We stopped killing qemu and qemu-nbd processes, leaving a lot of orphaned, running qemu processes after executing iotests. Since the process is using exec in the subshell, the PID is the same as the subshell PID. Track these PIDs for cleanup using pidfiles in the $TEST_DIR. Only track the qemu PID, however, if requested - not all usage requires killing the process. Reported-by: John Snow <jsnow@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Message-id: 9e4f958b3895b7259b98d845bb46f000ba362869.1446232490.git.jcody@redhat.com [mreitz@redhat.com: Replaced '! -z "..."' by '-n "..."'] Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-11-11gluster: allocate GlusterAIOCBs on the stackPaolo Bonzini1-53/+33
This is simpler now that the driver has been converted to coroutines. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
2015-11-11qemu-io: Correct error messagesJohn Snow1-19/+34
Reported-by: Max Reitz <mreitz@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-11qemu-io: Check for trailing charsJohn Snow1-1/+8
Make sure there's not trailing garbage, e.g. "64k-whatever-i-want-here" Reported-by: Max Reitz <mreitz@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-11qemu-io: fix cvtnum lval typesJohn Snow1-36/+89
cvtnum() returns int64_t: we should not be storing this result inside of an int. In a few cases, we need an extra sprinkling of error handling where we expect to pass this number on towards a function that expects something smaller than int64_t. Reported-by: Max Reitz <mreitz@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-11block: test 'blockdev-snapshot' using a file BDS as the overlayAlberto Garcia2-1/+15
This test checks that it is not possible to create a snapshot if the requested overlay node is a BDS which does not support backing images. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-11block: Remove inner quotation marks in iotest 085Alberto Garcia1-8/+8
This patch removes the inner quotation marks in all cases like this: cmd=" ... "${variable}" ... " Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-11block: Disallow snapshots if the overlay doesn't support backing filesAlberto Garcia1-0/+5
This addresses scenarios like this one: { 'execute': 'blockdev-add', 'arguments': { 'options': { 'driver': 'qcow2', 'node-name': 'new0', 'file': { 'driver': 'file', 'filename': 'new.qcow2', 'node-name': 'file0' } } } } { 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overlay': 'file0' } } Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-11throttle: Use bs->throttle_state instead of bs->io_limits_enabledAlberto Garcia4-7/+10
There are two ways to check for I/O limits in a BlockDriverState: - bs->throttle_state: if this pointer is not NULL, it means that this BDS is member of a throttling group, its ThrottleTimers structure has been initialized and its I/O limits are ready to be applied. - bs->io_limits_enabled: if true it means that the throttle_state pointer is valid _and_ the limits are currently enabled. The latter is used in several places to check whether a BDS has I/O limits configured, but what it really checks is whether requests are being throttled or not. For example, io_limits_enabled can be temporarily set to false in cases like bdrv_read_unthrottled() without otherwise touching the throtting configuration of that BDS. This patch replaces bs->io_limits_enabled with bs->throttle_state in all cases where what we really want to check is the existence of I/O limits, not whether they are currently enabled or not. Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-11throttle: Check for pending requests in throttle_group_unregister_bs()Alberto Garcia1-0/+7
throttle_group_unregister_bs() removes a BlockDriverState from its throttling group and destroys the timers. This means that there must be no pending throttled requests at that point (because it would be impossible to complete them), so the caller has to drain them first. At the moment throttle_group_unregister_bs() is only called from bdrv_io_limits_disable(), which already takes care of draining the requests, so there's nothing to worry about, but this patch makes this invariant explicit in the documentation and adds the relevant assertions. Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-11-11qemu-img: add check for zero-length job lenJohn Snow1-1/+2
The mirror job doesn't update its total length until it has already started running, so we should translate a zero-length job-len as meaning 0%. Otherwise, we may get divide-by-zero faults. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>