mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
vmdk: Reject excess extents in blockdev-create
Clarify that the number of extents provided in BlockdevCreateOptionsVmdk must match the number of extents that will actually be used. Providing more extents will result in an error now. This requires adapting the test case to provide the right number of extents. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
1c4e7b640b
commit
4a960ece17
4 changed files with 38 additions and 13 deletions
|
@ -20,6 +20,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
import math
|
||||
import iotests
|
||||
from iotests import imgfmt
|
||||
|
||||
|
@ -222,12 +223,15 @@ with iotests.FilePath('t.vmdk') as disk_path, \
|
|||
iotests.log("= %s %d =" % (subfmt, size))
|
||||
iotests.log("")
|
||||
|
||||
num_extents = math.ceil(size / 2.0**31)
|
||||
extents = [ "ext%d" % (i) for i in range(1, num_extents + 1) ]
|
||||
|
||||
vm.launch()
|
||||
blockdev_create(vm, { 'driver': imgfmt,
|
||||
'file': 'node0',
|
||||
'size': size,
|
||||
'subformat': subfmt,
|
||||
'extents': ['ext1', 'ext2', 'ext3'] })
|
||||
'extents': extents })
|
||||
vm.shutdown()
|
||||
|
||||
iotests.img_info_log(disk_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue