summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* trace: add "-trace help"Paolo Bonzini2019-11-293-1/+29
| | | | | | | | | | Print a list of trace points Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1452174932-28657-7-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: add "-trace enable=..."Paolo Bonzini2019-11-294-24/+54
| | | | | | | | | | | | | | | | | | Allow enabling events without going through a file, for example: qemu-system-x86_64 -trace bdrv_aio_writev -trace bdrv_aio_readv or with globbing too: qemu-system-x86_64 -trace 'bdrv_aio_*' if an appropriate backend is enabled (simple, stderr, ftrace). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1452174932-28657-6-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: no need to call trace_backend_init in different branches nowDenis V. Lunev2019-11-291-10/+2
| | | | | | | | | | | | | | | | | original idea to split calling locations was to spawn tracing thread in the final child process according to commit 8a745f2a9296ad2cf6bda33534ed298f2625a4ad Author: Michael Mueller Date: Mon Sep 23 16:36:54 2013 +0200 os_daemonize is now on top of both locations. Drop unneeded ifs. Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1452174932-28657-5-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: split trace_init_file out of trace_init_backendsPaolo Bonzini2019-11-296-17/+38
| | | | | | | | | | This is cleaner, and improves error reporting with -daemonize. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1452174932-28657-4-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: split trace_init_events out of trace_init_backendsPaolo Bonzini2019-11-294-11/+19
| | | | | | | | | | | | This is cleaner and has two advantages. First, it improves error reporting with -daemonize. Second, multiple "-trace events" options now cumulate. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1452174932-28657-3-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: fix documentationPaolo Bonzini2019-11-291-5/+5
| | | | | | | | | | Mention the ftrace backend too. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1452174932-28657-2-git-send-email-den@openvz.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: track enabled events in a separate arrayPaolo Bonzini2019-11-295-8/+14
| | | | | | | | This is more cache friendly on the fast path, where we already have the event id available. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* trace: count number of enabled eventsPaolo Bonzini2019-11-292-1/+5
| | | | | | | | | This lets trace_event_get_state_dynamic quickly return false. Right now there is hardly any benefit because there are also many assertions and indirections, but the next patch will streamline all of this. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* hmp: fix sendkey out of bounds write (CVE-2015-8619)Wolfgang Bumiller2019-11-293-13/+12
| | | | | | | | | | | | | | | | | | When processing 'sendkey' command, hmp_sendkey routine null terminates the 'keyname_buf' array. This results in an OOB write issue, if 'keyname_len' was to fall outside of 'keyname_buf' array. Since the keyname's length is known the keyname_buf can be removed altogether by adding a length parameter to index_from_key() and using it for the error output as well. Reported-by: Ling Liu <liuling-it@360.cn> Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com> Message-Id: <20160113080958.GA18934@olga> [Comparison with "<" dumbed down, test for junk after strtoul() tweaked] Signed-off-by: Markus Armbruster <armbru@redhat.com>
* block: qemu-iotests - add test for snapshot, commit, snapshot bugJeff Cody2019-11-293-0/+139
| | | | | | | | Signed-off-by: Jeff Cody <jcody@redhat.com> Message-id: 2dbc05efba2f683cb3aaf71aaa9b776ebf7ec57c.1454376655.git.jcody@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> [Moved test number from 143 to 144] Signed-off-by: Max Reitz <mreitz@redhat.com>
* block: set device_list.tqe_prev to NULL on BDS removalJeff Cody2019-11-293-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression introduced with commit 3f09bfbc7. Multiple bugs arise in conjunction with live snapshots and mirroring operations (which include active layer commit). After a live snapshot occurs, the active layer and the base layer both have a non-NULL tqe_prev field in the device_list, although the base node's tqe_prev field points to a NULL entry. This non-NULL tqe_prev field occurs after the bdrv_append() in the external snapshot calls change_parent_backing_link(). In change_parent_backing_link(), when the previous active layer is removed from device_list, the device_list.tqe_prev pointer is not set to NULL. The operating scheme in the block layer is to indicate that a BDS belongs in the bdrv_states device_list iff the device_list.tqe_prev pointer is non-NULL. This patch does two things: 1.) Introduces a new block layer helper bdrv_device_remove() to remove a BDS from the device_list, and 2.) uses that new API, which also fixes the regression once used in change_parent_backing_link(). Signed-off-by: Jeff Cody <jcody@redhat.com> Message-id: 0cd51e11c0666c04ddb7c05293fe94afeb551e89.1454376655.git.jcody@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Add "qemu-img map" test for VMDK extentsFam Zheng2019-11-292-0/+35
| | | | | | | Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-17-git-send-email-famz@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* qemu-img: Make MapEntry a QAPI structFam Zheng2019-11-292-29/+69
| | | | | | | | | | | | | The "flags" bit mask is expanded to two booleans, "data" and "zero"; "bs" is replaced with "filename" string. Refactor the merge conditions in img_map() into entry_mergeable(). Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-16-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* qemu-img: In "map", use the returned "file" from bdrv_get_block_statusFam Zheng2019-11-291-1/+1
| | | | | | | | | | | Now all drivers should return a correct "file", we can make use of it, even with the recursion into backing chain above. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-15-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* block: Use returned *file in bdrv_co_get_block_statusFam Zheng2019-11-291-2/+2
| | | | | | | | | Now that all drivers return the right "file" pointer, we can use it. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 1453780743-16806-14-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* vmdk: Return extent's file in bdrv_get_block_statusFam Zheng2019-11-291-2/+2
| | | | | | | Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-13-git-send-email-famz@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* vmdk: Fix calculation of block status's offsetFam Zheng2019-11-291-2/+4
| | | | | | | | | | "offset" is the offset of cluster and sector_num doesn't necessarily refer to the start of it, it should add index_in_cluster. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-12-git-send-email-famz@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* vpc: Assign bs->file->bs to file in vpc_co_get_block_statusFam Zheng2019-11-291-0/+2
| | | | | | | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-11-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* vdi: Assign bs->file->bs to file in vdi_co_get_block_statusFam Zheng2019-11-291-0/+1
| | | | | | | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-10-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* sheepdog: Assign bs to file in sd_co_get_block_statusFam Zheng2019-11-291-0/+3
| | | | | | | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-9-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_statusFam Zheng2019-11-291-0/+3
| | | | | | | | Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-8-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* parallels: Assign bs->file->bs to file in parallels_co_get_block_statusFam Zheng2019-11-291-0/+1
| | | | | | | | Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-7-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* iscsi: Assign bs to file in iscsi_co_get_block_statusFam Zheng2019-11-291-0/+3
| | | | | | | | Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-6-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* raw: Assign bs to file in raw_co_get_block_statusFam Zheng2019-11-292-0/+2
| | | | | | | Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-5-git-send-email-famz@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* qcow2: Assign bs->file->bs to file in qcow2_co_get_block_statusFam Zheng2019-11-291-0/+1
| | | | | | | Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-4-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* qcow: Assign bs->file->bs to file in qcow_co_get_block_statusFam Zheng2019-11-291-0/+1
| | | | | | | | Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-3-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* block: Add "file" output parameter to block status query functionsFam Zheng2019-11-2917-35/+66
| | | | | | | | | | | | | | | | | | The added parameter can be used to return the BDS pointer which the valid offset is referring to. Its value should be ignored unless BDRV_BLOCK_OFFSET_VALID in ret is set. Until block drivers fill in the right value, let's clear it explicitly right before calling .bdrv_get_block_status. The "bs->file" condition in bdrv_co_get_block_status is kept now to keep iotest case 102 passing, and will be fixed once all drivers return the right file pointer. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-2-git-send-email-famz@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* block: acquire in bdrv_query_image_infoPaolo Bonzini2019-11-291-2/+7
| | | | | | | | | | NFS calls aio_poll inside bdrv_get_allocated_size. This requires acquiring the AioContext. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1450867706-19860-1-git-send-email-pbonzini@redhat.com Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Add test for block jobs and BDS ejectionMax Reitz2019-11-293-0/+246
| | | | | | | Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Add test for multiple BB on BDS treeMax Reitz2019-11-293-0/+101
| | | | | | | | | | | | | | | This adds a test for having multiple BlockBackends in one BDS tree. In this case, there is one BB for the protocol BDS and one BB for the format BDS in a simple two-BDS tree (with the protocol BDS and BB added first). When bdrv_close_all() is executed, no cached data from any BDS should be lost; the protocol BDS may not be closed until the format BDS is closed. Otherwise, metadata updates may be lost. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Rewrite bdrv_close_all()Max Reitz2019-11-291-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch rewrites bdrv_close_all(): Until now, all root BDSs have been force-closed. This is bad because it can lead to cached data not being flushed to disk. Instead, try to make all reference holders relinquish their reference voluntarily: 1. All BlockBackend users are handled by making all BBs simply eject their BDS tree. Since a BDS can never be on top of a BB, this will not cause any of the issues as seen with the force-closing of BDSs. The references will be relinquished and any further access to the BB will fail gracefully. 2. All BDSs which are owned by the monitor itself (because they do not have a BB) are relinquished next. 3. Besides BBs and the monitor, block jobs and other BDSs are the only things left that can hold a reference to BDSs. After every remaining block job has been canceled, there should not be any BDSs left (and the loop added here will always terminate (as long as NDEBUG is not defined), because either all_bdrv_states will be empty or there will not be any block job left to cancel, failing the assertion). Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Add blk_remove_all_bs()Max Reitz2019-11-292-0/+16
| | | | | | | | | | | | | | | When bdrv_close_all() is called, instead of force-closing all root BlockDriverStates, it is better to just drop the reference from all BlockBackends and let them be closed automatically. This prevents BDS from getting closed that are still referenced by other BDS, which may result in loss of cached data. This patch adds a function for doing that, but does not yet incorporate it in bdrv_close_all(). Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* blockdev: Keep track of monitor-owned BDSMax Reitz2019-11-294-1/+37
| | | | | | | | As a side effect, we can now make x-blockdev-del's check whether a BDS is actually owned by the monitor explicit. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Add list of all BlockDriverStatesMax Reitz2019-11-292-0/+9
| | | | | | | | | | | We need this list so that bdrv_close_all() can keep track of which BDSs are still open after having removed the BDSs from all of the BBs and having released all monitor BDS references. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Make bdrv_close() staticMax Reitz2019-11-292-2/+3
| | | | | | | | | | | | | | There are no users of bdrv_close() left, except for one of bdrv_open()'s failure paths, bdrv_close_all() and bdrv_delete(), and that is good. Make bdrv_close() static so nobody makes the mistake of directly using bdrv_close() again. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* blockdev: Use blk_remove_bs() in do_drive_del()Max Reitz2019-11-291-1/+1
| | | | | | | Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Use blk_remove_bs() in blk_delete()Max Reitz2019-11-291-4/+3
| | | | | | | Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Remove BDS close notifierMax Reitz2019-11-295-19/+0
| | | | | | | | | It is unused now, so we can remove it. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* nbd: Switch from close to eject notifierMax Reitz2019-11-292-35/+18
| | | | | | | | | | | The NBD code uses the BDS close notifier to determine when a medium is ejected. However, now it should use the BB's BDS removal notifier for that instead of the BDS's close notifier. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* virtio-scsi: Catch BDS-BB removal/insertionMax Reitz2019-11-292-0/+65
| | | | | | | | Make use of the BDS-BB removal and insertion notifiers to remove or set up, respectively, virtio-scsi's op blockers. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* virtio-blk: Functions for op blocker managementMax Reitz2019-11-291-18/+59
| | | | | | | | | | | Put the code for setting up and removing op blockers into an own function, respectively. Then, we can invoke those functions whenever a BDS is removed from an virtio-blk BB or inserted into it. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Add BB-BDS remove/insert notifiersMax Reitz2019-11-292-0/+22
| | | | | | | | | | | | | | | | | bdrv_close() no longer signifies ejection of a medium, this is now done by removing the BDS from the BB. Therefore, we want to have a notifier for that in the BB instead of a close notifier in the BDS. The former is added now, the latter is removed later. Symmetrically, another notifier list is added that is invoked whenever a BDS is inserted. We will need that for virtio-blk and virtio-scsi, which can then remove their op blockers on BDS ejection and set them up on insertion. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Add test for eject under NBD serverMax Reitz2019-11-293-0/+109
| | | | | | | | | | This patch adds a test for ejecting the BlockBackend an NBD server is connected to (the NBD server is supposed to stop). Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Release named dirty bitmaps in bdrv_close()Max Reitz2019-11-291-8/+31
| | | | | | | | | | | | | bdrv_delete() is not very happy about deleting BlockDriverStates with dirty bitmaps still attached to them. In the past, we got around that very easily by relying on bdrv_close_all() bypassing bdrv_delete(), and bdrv_close() simply ignoring that condition. We should fix that by releasing all named dirty bitmaps in bdrv_close() (there should not be any unnamed bitmaps left) and moving the assertion from bdrv_delete() there. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Remove unused struct definition BlockFinishDataFam Zheng2019-11-291-8/+0
| | | | | | | | | Unused since 94db6d2d3. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Add test for a nonexistent NBD exportMax Reitz2019-11-293-0/+81
| | | | | | | | | Trying to connect to a nonexistent NBD export should not crash the server. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Make redirecting qemu's stderr optionalMax Reitz2019-11-291-2/+13
| | | | | | | | | | | | | | | Redirecting qemu's stderr to stdout makes working with the stderr output difficult due to the other file descriptor magic performed in _launch_qemu ("ambiguous redirect"). Add an option which specifies whether stderr should be redirected to stdout or not (allowing for other modes to be added in the future). Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Make _filter_nbd support more URL typesMax Reitz2019-11-291-1/+2
| | | | | | | | | | | | | This function should support URLs of the "nbd://" format (without swallowing the export name), and for "nbd:///" URLs it should replace "?socket=$TEST_DIR" by "?socket=TEST_DIR" because putting the Unix socket files into the test directory makes sense. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Make _filter_nbd drop log linesMax Reitz2019-11-292-11/+1
| | | | | | | | | The NBD log lines ("/your/source/dir/nbd/xyz.c:function():line: error") should not be converted to empty lines but removed altogether. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Move _filter_nbd into common.filterMax Reitz2019-11-292-12/+12
| | | | | | | | | _filter_nbd can be useful for other NBD tests, too, therefore it should reside in common.filter. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud