[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 5/6] qemu-iotests: add block-stream with inva
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 5/6] qemu-iotests: add block-stream with invalid speed value test |
Date: |
Tue, 24 Apr 2012 09:22:47 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 |
On 04/24/2012 07:53 AM, Stefan Hajnoczi wrote:
> Add a test to exercise the BlockJobSpeedInvalid error code path in the
> block-stream command. The 'speed' parameter allows the speed limit of
> the job to be applied immediately when the job starts instead of issuing
> a separate block-job-set-speed command later. If the parameter has an
> invalid value we expect to get an error and the job is not created.
>
> +
> + result = self.vm.qmp('block-stream', device='drive0')
> + self.assert_qmp(result, 'return', {})
> +
> + result = self.vm.qmp('block-job-set-speed', device='drive0',
> speed=-1)
> + self.assert_qmp(result, 'error/class', 'InvalidParameter')
> + self.assert_qmp(result, 'error/data/name', 'speed')
Here, you're at the mercy of the race that we just plugged by adding the
optional speed parameter. What happens if your testsuite is so delayed
that the block job finishes before you get to this point?
> +
> + result = self.vm.qmp('block-job-cancel', device='drive0')
> + self.assert_qmp(result, 'return', {})
Same race - what happens if your testsuite is so delayed that the block
job finishes before you get to this point?
Are we sure that the testsuite is setting up a long-enough-running block
job that this will never bite us in practice?
You're missing a test: where do you test that block-stream with valid
speed argument, followed by a query-block-job, reads back the speed that
was initially set?
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v2 3/6] block: change block-job-set-speed argument from 'value' to 'speed', (continued)
- [Qemu-devel] [PATCH v2 3/6] block: change block-job-set-speed argument from 'value' to 'speed', Stefan Hajnoczi, 2012/04/24
- [Qemu-devel] [PATCH v2 2/6] block: use Error mechanism instead of -errno for block_job_set_speed(), Stefan Hajnoczi, 2012/04/24
- [Qemu-devel] [PATCH v2 1/6] block: use Error mechanism instead of -errno for block_job_create(), Stefan Hajnoczi, 2012/04/24
- [Qemu-devel] [PATCH v2 5/6] qemu-iotests: add block-stream with invalid speed value test, Stefan Hajnoczi, 2012/04/24
- Re: [Qemu-devel] [PATCH v2 5/6] qemu-iotests: add block-stream with invalid speed value test,
Eric Blake <=
- [Qemu-devel] [PATCH v2 6/6] qemu-iotests: fix missing 'result' variable assignment in 030, Stefan Hajnoczi, 2012/04/24
- Re: [Qemu-devel] [PATCH v2 0/6] block: add optional 'speed' parameter to block-stream, Luiz Capitulino, 2012/04/24