qemu/tests/qemu-iotests
Kevin Wolf 4e4bf5c42c block: Attach bs->file only during .bdrv_open()
The way that attaching bs->file worked was a bit unusual in that it was
the only child that would be attached to a node which is not opened yet.
Because of this, the block layer couldn't know yet which permissions the
driver would eventually need.

This patch moves the point where bs->file is attached to the beginning
of the individual .bdrv_open() implementations, so drivers already know
what they are going to do with the child. This is also more consistent
with how driver-specific children work.

For a moment, bdrv_open() gets its own BdrvChild to perform image
probing, but instead of directly assigning this BdrvChild to the BDS, it
becomes a temporary one and the node name is passed as an option to the
drivers, so that they can simply use bdrv_open_child() to create another
reference for their own use.

This duplicated child for (the not opened yet) bs is not the final
state, a follow-up patch will change the image probing code to use a
BlockBackend, which is completely independent of bs.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
2017-02-24 16:09:23 +01:00
..
001
002
003
004
005
007
008
009
010
011
012
013
014
015
017
018
019
020
021
022
023
024
025
026
027
028
029
030
2017-02-24 16:09:23 +01:00
031
032
033
034
035
036
037
038
039
040
042
043
044
045
046
047
048
049
050
051
052
053
054
055
2016-09-20 22:12:57 +02:00
056
058
059
060
061
062
063
064
065
066
068
069
070
072
073
074
075
076
077
078
079
080
082
083
084
086
088
089
090
091
092
094
095
096
098
099
101
102
103
104
105
107
108
2016-08-08 13:05:43 +02:00
110
111
112
113
114
115
116
119
120
121
122
123
128
129
130
131
132
133
134
135
136
138
140
142
143
144
145
146
148
149
150
152
154
156
157
2016-07-13 13:41:39 +02:00
159
2016-09-20 22:10:57 +02:00
2016-09-20 22:10:57 +02:00
160
2016-09-20 22:10:57 +02:00
2016-09-20 22:10:57 +02:00
170
2016-09-20 22:10:57 +02:00
2016-09-20 22:10:57 +02:00
172
2016-10-27 16:29:14 -04:00
174
2017-02-12 00:47:42 +01:00
2017-02-12 00:47:42 +01:00

=== This is the QEMU I/O test suite ===

* Intro

This package contains a simple test suite for the I/O layer of qemu.
It does not require a guest, but only the qemu, qemu-img and qemu-io
binaries.  This does limit it to exercise the low-level I/O path only
but no actual block drivers like ide, scsi or virtio.

* Usage

Just run ./check to run all tests for the raw image format, or ./check
-qcow2 to test the qcow2 image format.  The output of ./check -h explains
additional options to test further image formats or I/O methods.

* Feedback and patches

Please send improvements to the test suite, general feedback or just
reports of failing tests cases to qemu-devel@nongnu.org with a CC:
to qemu-block@nongnu.org.