static void bdrv_assign_node_name(BlockDriverState *bs,

                                  const char *node_name,

                                  Error **errp)

{

    if (!node_name) {

        return;

    }



    /* empty string node name is invalid */

    if (node_name[0] == '\0') {

        error_setg(errp, "Empty node name");

        return;

    }



    /* takes care of avoiding namespaces collisions */

    if (bdrv_find(node_name)) {

        error_setg(errp, "node-name=%s is conflicting with a device id",

                   node_name);

        return;

    }



    /* takes care of avoiding duplicates node names */

    if (bdrv_find_node(node_name)) {

        error_setg(errp, "Duplicate node name");

        return;

    }



    /* copy node name into the bs and insert it into the graph list */

    pstrcpy(bs->node_name, sizeof(bs->node_name), node_name);

    QTAILQ_INSERT_TAIL(&graph_bdrv_states, bs, node_list);

}

static void bdrv_assign_node_name(BlockDriverState *bs,

                                  const char *node_name,

                                  Error **errp)

{

    if (!node_name) {

        return;

    }



    

    if (node_name[0] == '\0') {

        error_setg(errp, "Empty node name");

        return;

    }



    

    if (bdrv_find(node_name)) {

        error_setg(errp, "node-name=%s is conflicting with a device id",

                   node_name);

        return;

    }



    

    if (bdrv_find_node(node_name)) {

        error_setg(errp, "Duplicate node name");

        return;

    }



    

    pstrcpy(bs->node_name, sizeof(bs->node_name), node_name);

    QTAILQ_INSERT_TAIL(&graph_bdrv_states, bs, node_list);

}

static void FUNC_0(BlockDriverState *VAR_0,

                                  const char *VAR_1,

                                  Error **VAR_2)

{

    if (!VAR_1) {

        return;

    }



    

    if (VAR_1[0] == '\0') {

        error_setg(VAR_2, "Empty node name");

        return;

    }



    

    if (bdrv_find(VAR_1)) {

        error_setg(VAR_2, "node-name=%s is conflicting with a device id",

                   VAR_1);

        return;

    }



    

    if (bdrv_find_node(VAR_1)) {

        error_setg(VAR_2, "Duplicate node name");

        return;

    }



    

    pstrcpy(VAR_0->VAR_1, sizeof(VAR_0->VAR_1), VAR_1);

    QTAILQ_INSERT_TAIL(&graph_bdrv_states, VAR_0, node_list);

}

static void FUNC_0(BlockDriverState *VAR_0,
const char *VAR_1,
Error **VAR_2)
{ if (!VAR_1) { return; } if (VAR_1[0] == '\0') { error_setg(VAR_2, "Empty node name"); return; } if (bdrv_find(VAR_1)) { error_setg(VAR_2, "node-name=%s is conflicting with a device id",
VAR_1); return; } if (bdrv_find_node(VAR_1)) { error_setg(VAR_2, "Duplicate node name"); return; } pstrcpy(VAR_0->VAR_1, sizeof(VAR_0->VAR_1), VAR_1); QTAILQ_INSERT_TAIL(&graph_bdrv_states, VAR_0, node_list); }