mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
iotests: Skip 211 on insufficient memory
VDI keeps the whole bitmap in memory, and the maximum size (which is tested here) is 2 GB. This may not be available on all machines, and it rarely is available when running a 32 bit build. Fix this by making VM.run_job() return the error string if an error occurred, and checking whether that contains "Could not allocate bmap" in 211. If so, the test is skipped. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190218180646.30282-1-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
26c9296c31
commit
6a4e88e179
2 changed files with 7 additions and 2 deletions
|
@ -32,7 +32,9 @@ def blockdev_create(vm, options):
|
||||||
|
|
||||||
if 'return' in result:
|
if 'return' in result:
|
||||||
assert result['return'] == {}
|
assert result['return'] == {}
|
||||||
vm.run_job('job0')
|
error = vm.run_job('job0')
|
||||||
|
if error and 'Could not allocate bmap' in error:
|
||||||
|
iotests.notrun('Insufficient memory')
|
||||||
iotests.log("")
|
iotests.log("")
|
||||||
|
|
||||||
with iotests.FilePath('t.vdi') as disk_path, \
|
with iotests.FilePath('t.vdi') as disk_path, \
|
||||||
|
|
|
@ -532,7 +532,9 @@ class VM(qtest.QEMUQtestMachine):
|
||||||
log(result, filters, indent=indent)
|
log(result, filters, indent=indent)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
# Returns None on success, and an error string on failure
|
||||||
def run_job(self, job, auto_finalize=True, auto_dismiss=False):
|
def run_job(self, job, auto_finalize=True, auto_dismiss=False):
|
||||||
|
error = None
|
||||||
while True:
|
while True:
|
||||||
for ev in self.get_qmp_events_filtered(wait=True):
|
for ev in self.get_qmp_events_filtered(wait=True):
|
||||||
if ev['event'] == 'JOB_STATUS_CHANGE':
|
if ev['event'] == 'JOB_STATUS_CHANGE':
|
||||||
|
@ -541,13 +543,14 @@ class VM(qtest.QEMUQtestMachine):
|
||||||
result = self.qmp('query-jobs')
|
result = self.qmp('query-jobs')
|
||||||
for j in result['return']:
|
for j in result['return']:
|
||||||
if j['id'] == job:
|
if j['id'] == job:
|
||||||
|
error = j['error']
|
||||||
log('Job failed: %s' % (j['error']))
|
log('Job failed: %s' % (j['error']))
|
||||||
elif status == 'pending' and not auto_finalize:
|
elif status == 'pending' and not auto_finalize:
|
||||||
self.qmp_log('job-finalize', id=job)
|
self.qmp_log('job-finalize', id=job)
|
||||||
elif status == 'concluded' and not auto_dismiss:
|
elif status == 'concluded' and not auto_dismiss:
|
||||||
self.qmp_log('job-dismiss', id=job)
|
self.qmp_log('job-dismiss', id=job)
|
||||||
elif status == 'null':
|
elif status == 'null':
|
||||||
return
|
return error
|
||||||
else:
|
else:
|
||||||
iotests.log(ev)
|
iotests.log(ev)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue