qemu-e2k/tests
Alberto Garcia dd4118c792 block: Use bdrv_unref_child() for all children in bdrv_close()
bdrv_unref_child() does the following things:

  - Updates the child->bs->inherits_from pointer.
  - Calls bdrv_detach_child() to remove the BdrvChild from bs->children.
  - Calls bdrv_unref() to unref the child BlockDriverState.

When bdrv_unref_child() was introduced in commit 33a604075c it was not
used in bdrv_close() because the drivers that had additional children
(like quorum or blkverify) had already called bdrv_unref() on their
children during their own close functions.

This was changed later (in 0bd6e91a7e for quorum, in 3e586be0b2 for
blkverify) so there's no reason not to use bdrv_unref_child() in
bdrv_close() anymore.

After this there's also no need to remove bs->backing and bs->file
separately from the rest of the children, so bdrv_close() can be
simplified.

Now bdrv_close() unrefs all children (before this patch it was only
bs->file and bs->backing). As a result, none of the callers of
brvd_attach_child() should remove their reference to child_bs (because
this function effectively steals that reference). This patch updates a
couple of tests that were doing their own bdrv_unref().

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: 6d1d5feaa53aa1ab127adb73d605dc4503e3abd5.1557754872.git.berto@igalia.com
[mreitz: s/where/were/]
Signed-off-by: Max Reitz <mreitz@redhat.com>
2019-05-28 20:30:55 +02:00
..
acceptance BootLinuxSshTest: Test some userspace commands on Malta 2019-05-26 17:45:02 +02:00
data tests: acpi: refactor rebuild-expected-aml.sh to dump ACPI tables for a specified list of targets 2019-05-21 09:30:44 -04:00
decode decodetree: Properly diagnose fields overflowing an insn 2019-03-12 09:46:58 -07:00
docker tests/docker: Test more components on the Fedora default image 2019-05-28 10:28:51 +01:00
fp softfloat: Support float_round_to_odd more places 2019-02-26 14:08:03 +00:00
guest-debug
image-fuzzer
keys
libqos tests: fw_cfg: add a function to get the fw_cfg file 2019-05-23 14:10:31 +02:00
migration Clean up header guards that don't match their file name 2019-05-13 08:58:55 +02:00
multiboot tests/multiboot: Improve portability by searching bash in the $PATH 2019-03-08 12:26:45 +01:00
qapi-schema qapi: Fix array first used in a different module 2019-03-05 14:43:11 +01:00
qemu-iotests tests/qemu-iotests: re-format output to for make check-block 2019-05-28 10:28:51 +01:00
rocker
tcg tests/tcg/alpha: add system boot.S 2019-05-28 10:28:51 +01:00
uefi-test-tools tests/uefi-test-tools: report the SMBIOS entry point structures 2019-05-03 10:52:20 +02:00
vm Introduce a Python module structure 2019-02-22 14:07:01 -05:00
vmstate-static-checker-data
.gitignore tests/.gitignore: ignore test-qapi-emit-events.[ch] for in-tree builds 2019-03-14 16:02:13 +01:00
ac97-test.c qos-test: ac97 test node 2019-03-07 17:28:46 +01:00
acpi-utils.c tests: acpi: add acpi_find_rsdp_address_uefi() helper 2019-05-20 18:40:02 -04:00
acpi-utils.h tests: acpi: add acpi_find_rsdp_address_uefi() helper 2019-05-20 18:40:02 -04:00
ahci-test.c ahci-test: Drop dependence on global_qtest 2019-03-12 07:40:59 +01:00
atomic64-bench.c
atomic_add-bench.c
benchmark-crypto-cipher.c
benchmark-crypto-hash.c
benchmark-crypto-hmac.c
bios-tables-test.c tests: acpi: print error unable to dump ACPI table during rebuild 2019-05-21 09:30:57 -04:00
boot-order-test.c
boot-sector.c
boot-sector.h
boot-serial-test.c s390-bios: Factor finding boot device out of virtio code path 2019-04-12 12:40:35 +02:00
cdrom-test.c tests/cdrom-test: only include isapc cdrom test when g_test_slow() 2019-02-22 09:32:32 +00:00
check-block-qdict.c
check-block.sh
check-qdict.c tests: Move qdict-test-data.txt to tests/data/qobject/ 2019-03-07 22:05:54 +01:00
check-qjson.c
check-qlist.c
check-qlit.c
check-qnull.c
check-qnum.c
check-qobject.c
check-qom-interface.c
check-qom-proplist.c
check-qstring.c
cpu-plug-test.c
crypto-tls-psk-helpers.c
crypto-tls-psk-helpers.h
crypto-tls-x509-helpers.c
crypto-tls-x509-helpers.h
device-introspect-test.c tests/device-introspect: Use qtest_init() instead of qtest_start() 2019-05-21 10:00:41 +02:00
device-plug-test.c tests/device-plug: Add PHB unplug request test for spapr 2019-02-26 09:21:25 +11:00
display-vga-test.c
drive_del-test.c tests/drive_del-test: Use qtest_init() instead of qtest_start() 2019-05-08 17:45:54 +02:00
ds1338-test.c
e1000-test.c qos-test: e1000 test node 2019-03-07 17:28:47 +01:00
e1000e-test.c tests: qpci_unplug_acpi_device_test() should not rely on global_qtest 2019-05-08 17:45:54 +02:00
eepro100-test.c qos-test: eepro100 test node 2019-03-07 17:28:47 +01:00
endianness-test.c
es1370-test.c qos-test: es1370 test node 2019-03-07 17:28:46 +01:00
fdc-test.c tests: Remove (mostly) useless architecture checks 2019-03-06 10:10:36 +01:00
fw_cfg-test.c tests: fw_cfg: add 'splash-time' test case 2019-05-23 14:10:31 +02:00
hd-geo-test.c tests/hd-geo-test: Use qtest_init() instead of qtest_start() 2019-05-21 10:00:46 +02:00
hexloader-test.c
i440fx-test.c tests/libqos: rename qpci_init_pc and qpci_init_spapr functions 2019-03-07 16:50:04 +01:00
i82801b11-test.c
ide-test.c tests/ide-test: Make test independent of global_qtest 2019-05-08 16:59:28 +02:00
intel-hda-test.c
io-channel-helpers.c
io-channel-helpers.h
ioh3420-test.c
iothread.c
iothread.h
ipmi-bt-test.c tests: Remove (mostly) useless architecture checks 2019-03-06 10:10:36 +01:00
ipmi-kcs-test.c tests: Remove (mostly) useless architecture checks 2019-03-06 10:10:36 +01:00
ipoctal232-test.c qos-test: ipoctal232 test node 2019-03-07 17:28:46 +01:00
ivshmem-test.c tests: qpci_unplug_acpi_device_test() should not rely on global_qtest 2019-05-08 17:45:54 +02:00
libqtest.c tests/libqtest: Remove unused global_qtest-related wrapper functions 2019-05-21 09:57:45 +02:00
libqtest.h tests/libqtest: Fix description of qtest_vinitf() and qtest_initf() 2019-05-21 09:57:56 +02:00
m25p80-test.c
m48t59-test.c tests: Do not use "\n" in g_test_message() strings 2019-03-07 22:16:22 +01:00
machine-none-test.c
Makefile.include build: don't build hardware objects with linux-user 2019-05-17 15:19:39 +02:00
megasas-test.c tests/megasas: Make test independent of global_qtest 2019-05-08 16:59:28 +02:00
microbit-test.c tests/microbit-test: Add tests for nRF51 NVMC 2019-02-01 15:32:17 +00:00
migration-test.c test-migration: fix memory leak 2019-03-12 15:18:40 +01:00
ne2000-test.c qos-test: ne2k_pci test node 2019-03-07 17:28:46 +01:00
numa-test.c tests/numa-test: Use qtest_init() instead of qtest_start() 2019-05-21 10:00:32 +02:00
nvme-test.c qos-test: nvme test node 2019-03-07 17:28:46 +01:00
pca9552-test.c
pci-test.c tests/qgraph: add generic PCI testcases 2019-03-07 17:28:25 +01:00
pcnet-test.c qos-test: pcnet test node 2019-03-07 17:28:46 +01:00
pkix_asn1_tab.c
pnv-xscom-test.c ppc/pnv: activate XSCOM tests for POWER9 2019-03-12 14:33:05 +11:00
prom-env-test.c Suppress test warnings about missing Spectre/Meltdown mitigations with TCG 2019-03-12 16:07:14 +11:00
ptimer-test-stubs.c
ptimer-test.c
ptimer-test.h
pvpanic-test.c
pxe-test.c Suppress test warnings about missing Spectre/Meltdown mitigations with TCG 2019-03-12 16:07:14 +11:00
q35-test.c tests/q35-test: Make test independent of global_qtest 2019-05-21 10:00:27 +02:00
qemu-iotests-quick.sh
qht-bench.c
qmp-cmd-test.c tests/qmp-cmd-test: Use qtest_init() instead of qtest_start() 2019-05-08 16:59:28 +02:00
qmp-test.c
qom-test.c tests/qom-test: Use qtest_init() instead of qtest_start() 2019-05-21 10:00:37 +02:00
qos-test.c Clean up includes 2019-05-13 08:58:55 +02:00
rcutorture.c
requirements.txt BootLinuxSshTest: Test some userspace commands on Malta 2019-05-26 17:45:02 +02:00
rtas-test.c tests/libqos: embed allocators instead of malloc-ing them separately 2019-03-07 17:28:07 +01:00
rtc-test.c tests: Do not use "\n" in g_test_message() strings 2019-03-07 22:16:22 +01:00
rtl8139-test.c - qtest fixes 2019-03-08 16:31:34 +00:00
sdhci-test.c qos-test: sdhci test node 2019-03-07 17:28:25 +01:00
socket-helpers.c
socket-helpers.h
spapr-phb-test.c qos-test: spapr-phb test node 2019-03-07 17:28:46 +01:00
tco-test.c tests/tco: Make test independent of global_qtest 2019-05-08 16:59:28 +02:00
test-aio-multithread.c tests: Do not use "\n" in g_test_message() strings 2019-03-07 22:16:22 +01:00
test-aio.c
test-arm-mptimer.c
test-authz-list.c authz: add QAuthZList object type for an access control list 2019-02-26 15:32:18 +00:00
test-authz-listfile.c authz: add QAuthZListFile object type for a file access control list 2019-02-26 15:32:18 +00:00
test-authz-pam.c authz: add QAuthZPAM object type for authorizing using PAM 2019-02-26 15:32:19 +00:00
test-authz-simple.c authz: add QAuthZSimple object type for easy whitelist auth checks 2019-02-26 15:25:58 +00:00
test-base64.c
test-bdrv-drain.c block: Use bdrv_unref_child() for all children in bdrv_close() 2019-05-28 20:30:55 +02:00
test-bdrv-graph-mod.c block: Use bdrv_unref_child() for all children in bdrv_close() 2019-05-28 20:30:55 +02:00
test-bitcnt.c
test-bitops.c
test-block-backend.c
test-block-iothread.c test-block-iothread: Test AioContext propagation for block jobs 2019-05-20 17:08:57 +02:00
test-blockjob-txn.c
test-blockjob.c
test-bufferiszero.c
test-char.c test-char: fix undefined behavior 2019-03-12 15:18:40 +01:00
test-clone-visitor.c tests: Rename UserDefNativeListUnion to UserDefListUnion 2019-03-05 14:43:11 +01:00
test-coroutine.c tests: Do not use "\n" in g_test_message() strings 2019-03-07 22:16:22 +01:00
test-crypto-afsplit.c
test-crypto-block.c
test-crypto-cipher.c
test-crypto-hash.c
test-crypto-hmac.c
test-crypto-ivgen.c
test-crypto-pbkdf.c
test-crypto-secret.c
test-crypto-tlscredsx509.c
test-crypto-tlssession.c authz: delete existing ACL implementation 2019-02-26 15:32:19 +00:00
test-crypto-xts.c
test-cutils.c
test-filter-mirror.c test-filter-mirror: pass UNIX domain socket through fd 2019-02-04 16:03:20 +00:00
test-filter-redirector.c chardev: forbid 'wait' option with client sockets 2019-02-12 17:35:56 +01:00
test-hbitmap.c
test-hmp.c tests/test-hmp: Use qtest_init() instead of qtest_start() 2019-05-08 16:59:28 +02:00
test-image-locking.c
test-int128.c
test-io-channel-buffer.c
test-io-channel-command.c
test-io-channel-file.c
test-io-channel-socket.c
test-io-channel-tls.c authz: delete existing ACL implementation 2019-02-26 15:32:19 +00:00
test-io-task.c
test-iov.c
test-keyval.c
test-logging.c
test-mul64.c
test-netfilter.c
test-opts-visitor.c
test-qapi-util.c
test-qdev-global-props.c
test-qdist.c
test-qemu-opts.c
test-qga.c qmp: common 'id' handling & make QGA conform to QMP spec 2019-03-18 10:48:06 -05:00
test-qgraph.c tests: test-qgraph: fix a memory leak 2019-03-11 16:33:49 +01:00
test-qht-par.c
test-qht.c
test-qmp-cmds.c tests: Rename UserDefNativeListUnion to UserDefListUnion 2019-03-05 14:43:11 +01:00
test-qmp-event.c qapi: Generate QAPIEvent stuff into separate files 2019-02-18 14:44:04 +01:00
test-qobject-input-visitor.c tests: Rename UserDefNativeListUnion to UserDefListUnion 2019-03-05 14:43:11 +01:00
test-qobject-output-visitor.c tests: Rename UserDefNativeListUnion to UserDefListUnion 2019-03-05 14:43:11 +01:00
test-rcu-list.c
test-rcu-simpleq.c
test-rcu-tailq.c
test-replication.c
test-shift128.c
test-string-input-visitor.c
test-string-output-visitor.c
test-thread-pool.c
test-throttle.c
test-timed-average.c
test-util-filemonitor.c filemon: fix watch IDs to avoid potential wraparound issues 2019-04-02 13:52:02 +01:00
test-util-sockets.c qemu-print: New qemu_printf(), qemu_vprintf() etc. 2019-04-18 22:18:59 +02:00
test-uuid.c
test-visitor-serialization.c
test-vmstate.c
test-write-threshold.c
test-x86-cpuid-compat.c
test-x86-cpuid.c
test-xbzrle.c
tmp105-test.c
tpm-crb-swtpm-test.c
tpm-crb-test.c
tpm-emu.c
tpm-emu.h Clean up decorations and whitespace around header guards 2019-05-13 08:58:55 +02:00
tpm-tests.c tests/tpm-tests: Use g_test_skip() to mark skipped tests 2019-05-08 16:59:28 +02:00
tpm-tests.h
tpm-tis-swtpm-test.c
tpm-tis-test.c
tpm-util.c
tpm-util.h
usb-hcd-ehci-test.c tests/libqos: rename qpci_init_pc and qpci_init_spapr functions 2019-03-07 16:50:04 +01:00
usb-hcd-ohci-test.c qos-test: usb-hcd-ohci test node 2019-03-07 17:28:46 +01:00
usb-hcd-uhci-test.c
usb-hcd-xhci-test.c
vhost-user-bridge.c tests/vhost-user-bridge: Fix misuse of isdigit() 2019-05-22 15:00:04 +02:00
vhost-user-test.c hostmem-memfd: disable for systems without sealing support 2019-03-11 17:16:56 -03:00
virtio-9p-test.c qos-test: virtio-9p test node 2019-03-07 17:28:27 +01:00
virtio-blk-test.c tests: qpci_unplug_acpi_device_test() should not rely on global_qtest 2019-05-08 17:45:54 +02:00
virtio-ccw-test.c
virtio-net-test.c tests: qpci_unplug_acpi_device_test() should not rely on global_qtest 2019-05-08 17:45:54 +02:00
virtio-rng-test.c tests: qpci_unplug_acpi_device_test() should not rely on global_qtest 2019-05-08 17:45:54 +02:00
virtio-scsi-test.c qos-test: virtio-scsi test node 2019-03-07 17:28:42 +01:00
virtio-serial-test.c qos-test: virtio-console and virtio-serial test node 2019-03-07 17:28:27 +01:00
virtio-test.c tests/qgraph: add generic virtio testcases 2019-03-07 17:28:26 +01:00
vmgenid-test.c tests: acpi: make acpi_fetch_table() take size of fetched table pointer 2019-05-20 18:40:02 -04:00
vmxnet3-test.c qos-test: vmxnet3 test node 2019-03-07 17:28:46 +01:00
wdt_ib700-test.c