Re: [Qemu-devel] [PATCH 1/4] block: use Error mechanism instead of -errno for block_job_create()

2012-04-23 Thread Stefan Hajnoczi
On Mon, Apr 23, 2012 at 4:42 PM, Paolo Bonzini wrote: > Il 23/04/2012 17:39, Stefan Hajnoczi ha scritto: >> +    stream_start(bs, base_bs, base, block_stream_cb, bs, errp); >> +    if (error_is_set(errp)) { >> +        return; >>      } > > This needs to be > >    Error *local_err = NULL; >    str

Re: [Qemu-devel] [PATCH 1/4] block: use Error mechanism instead of -errno for block_job_create()

2012-04-23 Thread Paolo Bonzini
Il 23/04/2012 17:39, Stefan Hajnoczi ha scritto: > +stream_start(bs, base_bs, base, block_stream_cb, bs, errp); > +if (error_is_set(errp)) { > +return; > } This needs to be Error *local_err = NULL; stream_start(bs, base_bs, base, block_stream_cb, bs, &local_err);

[Qemu-devel] [PATCH 1/4] block: use Error mechanism instead of -errno for block_job_create()

2012-04-23 Thread Stefan Hajnoczi
The block job API uses -errno return values internally and we convert these to Error in the QMP functions. This is ugly because the Error should be created at the point where we still have all the relevant information. More importantly, it is hard to add new error cases to this case since we quic