summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-04-15nbd: fix assert() on qemu-nbd stopPavel Butsykin1-1/+1
From time to time qemu-nbd is crashing on the following assert: assert(state == TERMINATING); nbd_export_closed nbd_export_put main and the state at the moment of the crash is evaluated to TERMINATE. During shutdown process of the client the nbd_client_thread thread sends SIGTERM signal and the main thread calls the nbd_client_closed callback. If the SIGTERM callback will be executed after change the state to TERMINATING, then the state will once again be TERMINATE. To solve the issue, we must change the state to TERMINATE only if the state is RUNNING. In the other case we are shutting down already. Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> CC: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1460629215-11567-1-git-send-email-den@openvz.org Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-04-15nbd: Don't fail handshake on NBD_OPT_LIST descriptionsEric Blake1-2/+21
The NBD Protocol states that NBD_REP_SERVER may set 'length > sizeof(namelen) + namelen'; in which case the rest of the packet is a UTF-8 description of the export. While we don't know of any NBD servers that send this description yet, we had better consume the data so we don't choke when we start to talk to such a server. Also, a (buggy/malicious) server that replies with length < sizeof(namelen) would cause us to block waiting for bytes that the server is not sending, and one that replies with super-huge lengths could cause us to temporarily allocate up to 4G memory. Sanity check things before blindly reading incorrectly. Signed-off-by: Eric Blake <eblake@redhat.com> Message-id: 1460077777-31004-1-git-send-email-eblake@redhat.com Reviewed-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-04-15qemu-iotests: 041: More robust assertion on quorum nodeFam Zheng2-8/+18
Block nodes are now assigned names automatically, therefore the test case is fragile in using fixed indices in result. Introduce a method in iotests.py and do the matching more sensibly. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1460518995-1338-1-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-04-15qemu-iotests: place valgrind log file in scratch dirSascha Silbe1-1/+1
Do not place the valgrind log file at a predictable path in a world-writable location. Use the common scratch directory (${TEST_DIR}) instead. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by: Bo Tu <tubo@linux.vnet.ibm.com> Message-id: 1460472980-26319-5-git-send-email-silbe@linux.vnet.ibm.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-04-15qemu-iotests: tests: do not set unused tmp variableSascha Silbe117-117/+0
The previous commit removed the last usage of ${tmp} inside the tests themselves; the only remaining users are sourced by check. So we can now drop this variable from the tests. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by: Bo Tu <tubo@linux.vnet.ibm.com> Message-id: 1460472980-26319-4-git-send-email-silbe@linux.vnet.ibm.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-04-15qemu-iotests: common.rc: drop unused _do()Sascha Silbe1-46/+0
_do() was never used and possibly creates temporary files at predictable, world-writable locations. Get rid of it. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by: Bo Tu <tubo@linux.vnet.ibm.com> Message-id: 1460472980-26319-3-git-send-email-silbe@linux.vnet.ibm.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-04-15qemu-iotests: drop unused _within_tolerance() filterSascha Silbe1-101/+0
_within_tolerance() isn't used anymore and possibly creates temporary files at predictable, world-writable locations. Get rid of it. If it's needed again in the future it can be revived easily and fixed up to use TEST_DIR and / or safely created temporary files. Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by: Bo Tu <tubo@linux.vnet.ibm.com> Message-id: 1460472980-26319-2-git-send-email-silbe@linux.vnet.ibm.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-04-15Fix pflash migrationDr. David Alan Gilbert1-2/+16
Pflash migration (e.g. q35 + EFI variable storage) fails with the assert: bdrv_co_do_pwritev: Assertion `!(bs->open_flags & 0x0800)' failed. This avoids the problem by delaying the pflash update until after the device loads complete. Tested by: Migrating Q35/EFI vm. Changing efi variable content (with efiboot in the guest) md5sum'ing the variable file before migration and after. This is a fix that Paolo posted in the message 570244B3.4070105@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-04-15block: Don't ignore flags in blk_{,co,aio}_write_zeroes()Kevin Wolf1-3/+4
Commit 57d6a428 neglected to pass the given flags to blk_aio_prwv(), which broke discard by WRITE SAME for scsi-disk (the UNMAP bit would be ignored). Commit fc1453cd introduced the same bug for blk_write_zeroes(). This is used for 'qemu-img convert' without has_zero_init (e.g. on a block device) and for preallocation=falloc in parallels. Commit 8896e088 is the version for blk_co_write_zeroes(). This function is only used in qemu-io. Reported-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2016-04-15block/vpc: update comments to be compliant w/coding guidelinesJeff Cody1-34/+34
Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-04-15block/vpc: set errp in vpc_openJeff Cody1-0/+9
Add more useful error information to failure paths in vpc_open Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-04-15block/vpc: make checks on max table size a bit more laxJeff Cody1-4/+0
The check on the max_table_size field not being larger than required is valid, and in accordance with the VHD spec. However, there have been VHD images encountered in the wild that have an out-of-spec max table size that is technically too large. There is no issue in allowing this larger table size, as we also later verify that the computed size (used for the pagetable) is large enough to fit all sectors. In addition, max_table_entries is bounds checked against SIZE_MAX and INT_MAX. Remove the strict check, so that we can accomodate these sorts of images that are benignly out of spec. Reported-by: Stefan Hajnoczi <stefanha@redhat.com> Reported-by: Grant Wu <grantwwu@gmail.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-04-15block/vpc: Use the correct max sector count for VHD imagesJeff Cody1-5/+5
The old VHD_MAX_SECTORS value is incorrect, and is a throwback to the CHS calculations. The VHD specification allows images up to 2040 GiB, which (using 512 byte sectors) corresponds to a maximum number of sectors of 0xff000000, rather than the old value of 0xfe0001ff. Update VHD_MAX_SECTORS to reflect the correct value. Also, update comment references to the actual size limit, and correct one compare so that we can have sizes up to the limit. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-04-15block/vpc: use current_size field for XenConverter VHD imagesJeff Cody1-0/+2
XenConverter VHD images are another VHD image where current_size is different from the CHS values in the the format header. Use current_size as the default, by looking at the creator_app signature field. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-04-15vpc: use current_size field for XenServer VHD imagesStefan Hajnoczi1-1/+3
The vpc driver has two methods of determining virtual disk size. The correct one to use depends on the software that generated the image file. Add the XenServer creator_app signature so that image size is correctly detected for those images. Reported-by: Grant Wu <grantwwu@gmail.com> Reported-by: Spencer Baugh <sbaugh@catern.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-04-15block/vpc: set errp in vpc_createJeff Cody1-0/+5
Add more useful error information to failure paths in vpc_create(). Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-04-15block: Fix blk_aio_write_zeroes()Kevin Wolf3-10/+100
Commit 57d6a428 broke blk_aio_write_zeroes() because in some write functions in the call path don't have an explicit length argument but reuse qiov->size instead. Which is great, except that write_zeroes doesn't have a qiov, which this commit interprets as 0 bytes. Consequently, blk_aio_write_zeroes() didn't effectively do anything. This patch introduces an explicit acb->bytes in BlkAioEmAIOCB and uses that instead of acb->rwco.size. The synchronous version of the function is okay because it does pass a qiov (with the right size and a NULL pointer as its base). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2016-04-15qemu-io: Support 'aio_write -z'Kevin Wolf1-16/+49
This allows testing blk_aio_write_zeroes(). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
2016-04-15Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into ↵Peter Maydell2-9/+8
staging qemu-sparc update # gpg: Signature made Fri 15 Apr 2016 09:30:58 BST using RSA key ID AE0F321F # gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>" * remotes/mcayland/tags/qemu-sparc-signed: target-sparc: fix Trap Based Address Register behavior for sparc64 target-sparc: fix Nucleus quad LDD 128 bit access for windowed registers Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-04-15target-sparc: fix Trap Based Address Register behavior for sparc64Artyom Tarasenko1-3/+2
Accoding the chapter 7.6 Trap Processing of the SPARC Architecture Manual v9, the Trap Based Address Register is not modified as a trap is taken. This fix allows booting FreeBSD-10.3-RELEASE-sparc64. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-04-15target-sparc: fix Nucleus quad LDD 128 bit access for windowed registersArtyom Tarasenko1-6/+6
Fix register offset calculation when regwptr is used. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-04-14Update version for v2.6.0-rc2 releasev2.6.0-rc2Peter Maydell1-1/+1
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-04-14Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell4-6/+17
tpm, vhost, virtio: fixes for 2.6 Minor fixes all over the place. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 14 Apr 2016 14:45:55 BST using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: hw/virtio/balloon: Replace TARGET_PAGE_SIZE with BALLOON_PAGE_SIZE tpm: Fix write to file descriptor function tpm: acpi: remove IRQ from TPM's CRS to make Windows not see conflict pc: acpi: tpm: add missing MMIO resource to PCI0._CRS specs/vhost-user: spelling fix specs/vhost-user: improve VHOST_SET_VRING_NUM documentation Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-04-14hw/virtio/balloon: Replace TARGET_PAGE_SIZE with BALLOON_PAGE_SIZEThomas Huth1-2/+3
The balloon code currently calls madvise() with TARGET_PAGE_SIZE as length parameter. Since the virtio-balloon protocol is always based on 4k pages, no matter what the host and guest are using as page size, this could cause problems: If TARGET_PAGE_SIZE is bigger than 4k, the madvise call also destroys the 4k areas after the current one - which might be wrong since the guest did not want free that area yet (in case the guest used as smaller MMU page size than the hard-coded TARGET_PAGE_SIZE). So to fix this issue, introduce a proper define called BALLOON_PAGE_SIZE (which is 4096) to use this as the size parameter for the madvise() call instead. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-04-13Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-20160413-1' ↵Peter Maydell6-26/+162
into staging virtio-input; live migration support, various bugfixes. # gpg: Signature made Wed 13 Apr 2016 16:41:27 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-input-20160413-1: virtio-input: support absolute axis config in pass-through input-linux: refine mouse detection virtio-input: fix emulated tablet axis ranges virtio-input: add live migration support virtio-input: implement pass-through evdev writes virtio-input: retrieve EV_LED host config bits virtio-input: add missing key mappings move const_le{16, 23} to qemu/bswap.h, add comment virtio-input: add parenthesis to const_le{16, 32} Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-04-13Merge remote-tracking branch 'remotes/elmarco/tags/ivshmem-fix-pull-request' ↵Peter Maydell1-0/+30
into staging # gpg: Signature made Wed 13 Apr 2016 11:04:51 BST using RSA key ID 75969CE5 # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" # gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 87A9 BD93 3F87 C606 D276 F62D DAE8 E109 7596 9CE5 * remotes/elmarco/tags/ivshmem-fix-pull-request: ivshmem: fix ivshmem-{plain,doorbell} crash without arg Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-04-13tpm: Fix write to file descriptor functionStefan Berger1-1/+1
Fix a bug introduced in commit 46f296c while moving send_all to the tpm_passthrough code. Fix the name of the variable used in the loop. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-04-13tpm: acpi: remove IRQ from TPM's CRS to make Windows not see conflictIgor Mammedov1-1/+6
IRQ 5 used by TPM conflicts with PNP0C0F IRQs, as result Windows fails driver initialization with reason 'device cannot find enough free resources' But if TPM._CRS.IRQ entry is commented out, Windows seems to initialize driver without errors as it doesn't notice possible conflict and it seems to work probably due to a link with IRQ 5 being unused/disabled. So temporary comment out TPM._CRS.IRQ to 'fix' regression in TPM, with intent to fix it correctly later i.e.: 1. pick unused IRQ as default one for TPM 2. fetch IRQ value from device model so that user could override default one if it conflicts with some other device. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-04-13pc: acpi: tpm: add missing MMIO resource to PCI0._CRSIgor Mammedov1-0/+5
Windows will fail initialize TMP driver with the reason: 'device cannot find enough free resources' That happens because parent BUS doesn't describe MMIO resources used by TPM child device. Fix it by describing it in top-most parent bus scope PCI0. It was 'regressed' by commit 5cb18b3d TPM2 ACPI table support with following fixup 9e472263 acpi: add missing ssdt which did the right thing by moving TPM to BUS it belongs to but lacked a proper resource declaration. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-04-13specs/vhost-user: spelling fixMarc-André Lureau1-1/+1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-04-13specs/vhost-user: improve VHOST_SET_VRING_NUM documentationMarc-André Lureau1-1/+1
"number of vrings" doesn't help me understand the purpose of this message. My understanding is that it is rather the size of the queue (in modern terms). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-04-13Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into stagingPeter Maydell6-37/+70
# gpg: Signature made Wed 13 Apr 2016 00:32:22 BST using RSA key ID AAFC390E # gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>" * remotes/jnsnow/tags/ide-pull-request: ide: really restart pending and in-flight atapi dma ide: restart atapi dma by re-evaluating command packet ide: don't lose pending dma state xen: Fix IDE unplug Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-04-13virtio-input: support absolute axis config in pass-throughLadi Prosek3-5/+50
VIRTIO_INPUT_CFG_ABS_INFO was not implemented for pass-through input devices. This patch follows the existing design and pre-fetches the config for all absolute axes using EVIOCGABS at realize time. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Message-id: 1460558603-18331-1-git-send-email-lprosek@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-04-13input-linux: refine mouse detectionGerd Hoffmann1-5/+25
Read absolute and relative axis information, only classify devices as mouse/tablet in case the x axis is present. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-04-13virtio-input: fix emulated tablet axis rangesLadi Prosek1-2/+2
The reported maximum was wrong. The X and Y coordinates are 0-based so if size is 8000 maximum must be 7FFF. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Message-id: 1460128893-10244-1-git-send-email-lprosek@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-04-13virtio-input: add live migration supportGerd Hoffmann1-0/+40
virtio-input is simple enough that it doesn't need to xfer any state. Still we have to wire up savevm manually, so the generic pci and virtio are saved correctly. Additionally we need to do some post-load processing to figure whenever the guest uses the device or not, so we can give input routing hints to the qemu input layer using qemu_input_handler_{activate,deactivate}. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1459859501-16965-1-git-send-email-kraxel@redhat.com
2016-04-13virtio-input: implement pass-through evdev writesLadi Prosek1-0/+23
The write path for pass-through devices, commonly used for controlling keyboard LEDs via EV_LED, was not implemented. This commit adds the necessary plumbing to connect the status virtio queue to the host evdev file descriptor. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Message-id: 1459511146-12060-1-git-send-email-lprosek@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-04-13virtio-input: retrieve EV_LED host config bitsLadi Prosek1-0/+1
VIRTIO_INPUT_CFG_EV_BITS with subsel of EV_LED was always returning an empty bitmap for pass-through input devices. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Message-id: 1459418028-7473-1-git-send-email-lprosek@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-04-13virtio-input: add missing key mappingsLadi Prosek1-0/+2
KEY_PAUSE is flat out missing. KEY_SYSRQ already has a keycode assigned but it's not what I'm seeing on my system. The mapping doesn't appear to have to be unique so both keycodes now map to KEY_SYSRQ which is what the "Keyboard PrintScreen", HID usage ID 0x46, translates to. Signed-off-by: Ladi Prosek <lprosek@redhat.com> Message-id: 1459343240-19483-1-git-send-email-lprosek@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-04-13move const_le{16, 23} to qemu/bswap.h, add commentGerd Hoffmann2-14/+19
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1460441239-867-1-git-send-email-kraxel@redhat.com
2016-04-13virtio-input: add parenthesis to const_le{16, 32}Gerd Hoffmann1-6/+6
"_x" must be "(_x)" otherwise things fail if you pass in expressions. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1460440299-26654-1-git-send-email-kraxel@redhat.com
2016-04-13ivshmem: fix ivshmem-{plain,doorbell} crash without argMarc-André Lureau1-0/+30
"qemu -device ivshmem-{plain,doorbell}" will crash, because the device doesn't check that the required argument is provided. (screwed up in commit 5400c02) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2016-04-12ide: really restart pending and in-flight atapi dmaPavel Butsykin4-22/+43
Restart of ATAPI DMA used to be unreachable, because the request to do so wasn't indicated in bus->error_status due to the lack of spare bits, and ide_restart_bh() would return early doing nothing. This patch makes use of the observation that not all bit combinations were possible in ->error_status. In particular, IDE_RETRY_READ only made sense together with IDE_RETRY_DMA or IDE_RETRY_PIO. This allows to re-use IDE_RETRY_READ alone as an indicator of ATAPI DMA restart request. To makes things more uniform, ATAPI DMA gets its own value for ->dma_cmd. As a means against confusion, macros are added to test the state of ->error_status. The patch fixes the restart of both in-flight and pending ATAPI DMA, following the scheme similar to that of IDE DMA. [Including a fixup patch: Message-id: 1460465594-15777-1-git-send-email-pbutsykin@virtuozzo.com --js] Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Roman Kagan <rkagan@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 1459924806-306-4-git-send-email-den@openvz.org Signed-off-by: John Snow <jsnow@redhat.com>
2016-04-12ide: restart atapi dma by re-evaluating command packetPavel Butsykin1-7/+6
ide_atapi_dma_restart() used to just complete the DMA with an error, under the assumption that there isn't enough information to restart it. However, as the contents of the ->io_buffer is preserved, it looks safe to just re-evaluate it and dispatch the ATAPI command again. Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> Reviewed-by: Roman Kagan <rkagan@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 1459924806-306-3-git-send-email-den@openvz.org Signed-off-by: John Snow <jsnow@redhat.com>
2016-04-12ide: don't lose pending dma statePavel Butsykin3-8/+20
If the migration occurs after the IDE DMA has been set up but before it has been initiated, the state gets lost upon save/restore. Specifically, ->dma_cb callback gets cleared, so, when the guest eventually starts bus mastering, the DMA never completes, causing the guest to time out the operation. OTOH all the infrastructure is already in place to restart the DMA if the migration happens while the DMA is in progress. So reuse that infrastructure, by setting bus->error_status based on ->dma_cmd in pre_save if ->dma_cb callback is already set but DMAING is clear. This will indicate the need for restart and make sure ->dma_cb is restored in ide_restart_bh(); howeover since DMAING is clear the state upon restore will be exactly "ready for DMA" as before the save. Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> Reviewed-by: Roman Kagan <rkagan@virtuozzo.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 1459924806-306-2-git-send-email-den@openvz.org Signed-off-by: John Snow <jsnow@redhat.com>
2016-04-12xen: Fix IDE unplugAnthony PERARD1-0/+1
After commit e5e7855 (blockdev: Separate BB name management), starting a guest with PVHVM support result in this assert: qemu-system-i386: block/block-backend.c:173: blk_delete: Assertion `!blk->name' failed. A backtrace show that a caller is pci_piix3_xen_ide_unplug(). This patch fix it. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Message-id: 1460382666-29885-1-git-send-email-anthony.perard@citrix.com Signed-off-by: John Snow <jsnow@redhat.com>
2016-04-12Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell14-89/+196
Block layer patches for 2.6 # gpg: Signature made Tue 12 Apr 2016 17:10:29 BST using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: qemu-iotests: iotests.py: get rid of __all__ qemu-iotests: 068: don't require KVM qemu-iotests: 148: properly skip test if quorum support is missing qemu-iotests: iotests.VM: remove qtest socket on error qemu-iotests: fix 051 on non-PC architectures qemu-iotests: check: don't place files with predictable names in /tmp MAINTAINERS: Block layer core, qcow2 and blkdebug qcow2: Prevent backing file names longer than 1023 vpc: fix return value check for blk_pwrite iotests: Make 150 use qemu-img map instead of du block: initialize qcrypto API at startup qemu-img: fix formatting of error message iotests: fix the broken 026.nocache output Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-04-12Merge remote-tracking branch 'mreitz/tags/pull-block-for-kevin-2016-04-12' ↵Kevin Wolf5-24/+35
into queue-block Block patches for 2.6-rc2. # gpg: Signature made Tue Apr 12 18:08:20 2016 CEST using RSA key ID E838ACAD # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" * mreitz/tags/pull-block-for-kevin-2016-04-12: qemu-iotests: iotests.py: get rid of __all__ qemu-iotests: 068: don't require KVM qemu-iotests: 148: properly skip test if quorum support is missing qemu-iotests: iotests.VM: remove qtest socket on error qemu-iotests: fix 051 on non-PC architectures qemu-iotests: check: don't place files with predictable names in /tmp Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-04-12qemu-iotests: iotests.py: get rid of __all__Sascha Silbe1-4/+0
The __all__ list contained a typo for as long as the iotests module existed. That typo prevented "from iotests import *" (which is the only case where iotests.__all__ is used at all) from ever working. The names used by iotests are highly prone to name collisions, so importing them all unconditionally is a bad idea anyway. Since __all__ is not adding any value, let's just get rid of it. Fixes: f345cfd0 ("qemu-iotests: add iotests Python module") Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by: Bo Tu <tubo@linux.vnet.ibm.com> Message-id: 1459848109-29756-8-git-send-email-silbe@linux.vnet.ibm.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2016-04-12qemu-iotests: 068: don't require KVMSascha Silbe1-1/+1
None of the other test cases explicitly enable KVM and there's no obvious reason for 068 to require it. Drop this so all test cases can be executed in environments where KVM is not available (e.g. because the user doesn't have sufficient permissions to access /dev/kvm). Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Reviewed-by: Bo Tu <tubo@linux.vnet.ibm.com> Message-id: 1459848109-29756-6-git-send-email-silbe@linux.vnet.ibm.com Signed-off-by: Max Reitz <mreitz@redhat.com>