void qmp_block_stream(const char *device, bool has_base,

                      const char *base, Error **errp)

{

    BlockDriverState *bs;

    BlockDriverState *base_bs = NULL;

    Error *local_err = NULL;



    bs = bdrv_find(device);

    if (!bs) {

        error_set(errp, QERR_DEVICE_NOT_FOUND, device);

        return;

    }



    if (base) {

        base_bs = bdrv_find_backing_image(bs, base);

        if (base_bs == NULL) {

            error_set(errp, QERR_BASE_NOT_FOUND, base);

            return;

        }

    }



    stream_start(bs, base_bs, base, block_stream_cb, bs, &local_err);

    if (error_is_set(&local_err)) {

        error_propagate(errp, local_err);

        return;

    }



    /* Grab a reference so hotplug does not delete the BlockDriverState from

     * underneath us.

     */

    drive_get_ref(drive_get_by_blockdev(bs));



    trace_qmp_block_stream(bs, bs->job);

}

void qmp_block_stream(const char *device, bool has_base,

                      const char *base, Error **errp)

{

    BlockDriverState *bs;

    BlockDriverState *base_bs = NULL;

    Error *local_err = NULL;



    bs = bdrv_find(device);

    if (!bs) {

        error_set(errp, QERR_DEVICE_NOT_FOUND, device);

        return;

    }



    if (base) {

        base_bs = bdrv_find_backing_image(bs, base);

        if (base_bs == NULL) {

            error_set(errp, QERR_BASE_NOT_FOUND, base);

            return;

        }

    }



    stream_start(bs, base_bs, base, block_stream_cb, bs, &local_err);

    if (error_is_set(&local_err)) {

        error_propagate(errp, local_err);

        return;

    }



    





    drive_get_ref(drive_get_by_blockdev(bs));



    trace_qmp_block_stream(bs, bs->job);

}

void FUNC_0(const char *VAR_0, bool VAR_1,

                      const char *VAR_2, Error **VAR_3)

{

    BlockDriverState *bs;

    BlockDriverState *base_bs = NULL;

    Error *local_err = NULL;



    bs = bdrv_find(VAR_0);

    if (!bs) {

        error_set(VAR_3, QERR_DEVICE_NOT_FOUND, VAR_0);

        return;

    }



    if (VAR_2) {

        base_bs = bdrv_find_backing_image(bs, VAR_2);

        if (base_bs == NULL) {

            error_set(VAR_3, QERR_BASE_NOT_FOUND, VAR_2);

            return;

        }

    }



    stream_start(bs, base_bs, VAR_2, block_stream_cb, bs, &local_err);

    if (error_is_set(&local_err)) {

        error_propagate(VAR_3, local_err);

        return;

    }



    





    drive_get_ref(drive_get_by_blockdev(bs));



    trace_qmp_block_stream(bs, bs->job);

}

void FUNC_0(const char *VAR_0, bool VAR_1,
const char *VAR_2, Error **VAR_3)
{ BlockDriverState *bs; BlockDriverState *base_bs = NULL; Error *local_err = NULL; bs = bdrv_find(VAR_0); if (!bs) { error_set(VAR_3, QERR_DEVICE_NOT_FOUND, VAR_0); return; } if (VAR_2) { base_bs = bdrv_find_backing_image(bs, VAR_2); if (base_bs == NULL) { error_set(VAR_3, QERR_BASE_NOT_FOUND, VAR_2); return; } } stream_start(bs, base_bs, VAR_2, block_stream_cb, bs, &local_err); if (error_is_set(&local_err)) { error_propagate(VAR_3, local_err); return; } drive_get_ref(drive_get_by_blockdev(bs)); trace_qmp_block_stream(bs, bs->job); }