On 9 March 2018 at 16:19, Kevin Wolf <[email protected]> wrote:
> This adds the .bdrv_co_create driver callback to file, which enables
> image creation over QMP.
> +static int coroutine_fn raw_co_create_opts(const char *filename, QemuOpts 
> *opts,
> +                                           Error **errp)
> +{
> +    BlockdevCreateOptions options;
> +    int64_t total_size = 0;
> +    bool nocow = false;
> +    PreallocMode prealloc;
> +    char *buf = NULL;
> +    Error *local_err = NULL;
> +
> +    /* Skip file: protocol prefix */
> +    strstart(filename, "file:", &filename);

This isn't new, but the code-motion causes Coverity to notice
(CID 1390569) that this strstart() return value isn't checked (which
we apparently do in 98 of the other 100 callsites). The "doesn't
begin with 'file:'" case can't happen given the BlockDriver struct
definition, though, so I've marked the warning as false-positive.
I mention it just in case you think it's worth adding an
"assert(filename);" here (and similarly in file-win32.c).

thanks
-- PMM

Reply via email to