[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/4] block: add 'speed' optional parameter to bl
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 3/4] block: add 'speed' optional parameter to block-stream |
Date: |
Mon, 23 Apr 2012 17:51:03 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 |
Il 23/04/2012 17:39, Stefan Hajnoczi ha scritto:
> + /* Only set speed when necessary to avoid NotSupported error */
> + if (speed != 0) {
> + Error *local_err = NULL;
> +
> + block_job_set_speed(job, speed, &local_err);
> + if (error_is_set(&local_err)) {
> + bs->job = NULL;
> + g_free(job);
> + bdrv_set_in_use(bs, 0);
> + error_propagate(errp, local_err);
> + return NULL;
> + }
> + }
Similarly, here I would instead modify the QAPI entry point, and add a
call to qmp_block_job_set_speed there.
In patch 2, qmp_block_job_set_speed can parse the return code to
distinguish ENOTSUP from EINVAL.
Paolo