static int qcow2_change_backing_file(BlockDriverState *bs,

    const char *backing_file, const char *backing_fmt)

{

    /* Backing file format doesn't make sense without a backing file */

    if (backing_fmt && !backing_file) {

        return -EINVAL;

    }



    pstrcpy(bs->backing_file, sizeof(bs->backing_file), backing_file ?: "");

    pstrcpy(bs->backing_format, sizeof(bs->backing_format), backing_fmt ?: "");



    return qcow2_update_header(bs);

}

static int qcow2_change_backing_file(BlockDriverState *bs,

    const char *backing_file, const char *backing_fmt)

{

    

    if (backing_fmt && !backing_file) {

        return -EINVAL;

    }



    pstrcpy(bs->backing_file, sizeof(bs->backing_file), backing_file ?: "");

    pstrcpy(bs->backing_format, sizeof(bs->backing_format), backing_fmt ?: "");



    return qcow2_update_header(bs);

}

static int FUNC_0(BlockDriverState *VAR_0,

    const char *VAR_1, const char *VAR_2)

{

    

    if (VAR_2 && !VAR_1) {

        return -EINVAL;

    }



    pstrcpy(VAR_0->VAR_1, sizeof(VAR_0->VAR_1), VAR_1 ?: "");

    pstrcpy(VAR_0->backing_format, sizeof(VAR_0->backing_format), VAR_2 ?: "");



    return qcow2_update_header(VAR_0);

}

static int FUNC_0(BlockDriverState *VAR_0,
const char *VAR_1, const char *VAR_2)
{ if (VAR_2 && !VAR_1) { return -EINVAL; } pstrcpy(VAR_0->VAR_1, sizeof(VAR_0->VAR_1), VAR_1 ?: ""); pstrcpy(VAR_0->backing_format, sizeof(VAR_0->backing_format), VAR_2 ?: ""); return qcow2_update_header(VAR_0); }