static int doAssignAddress(struct nc_state_t *nc, ncMetadata * pMeta, char *instanceId, char *publicIp)
{
    ncInstance *instance = NULL;

    if (instanceId == NULL || publicIp == NULL) {
        LOGERROR("[%s] internal error (bad input parameters to doAssignAddress)\n", instanceId);
        return (EUCA_INVALID_ERROR);
    }

    sem_p(inst_sem);
    {
        if ((instance = find_instance(&global_instances, instanceId)) != NULL) {
            snprintf(instance->ncnet.publicIp, 24, "%s", publicIp);
            save_instance_struct(instance);
        }
        copy_instances();
    }
    sem_v(inst_sem);

    return EUCA_OK;
}
static int doAssignAddress(struct nc_state_t *nc, ncMetadata * pMeta, char *instanceId, char *publicIp)
{
    ncInstance *instance = NULL;

    if (instanceId == NULL || publicIp == NULL) {
        LOGERROR("[%s] internal error (bad input parameters to doAssignAddress)\n", instanceId);
        return (EUCA_INVALID_ERROR);
    }

    sem_p(inst_sem);
    {
        if ((instance = find_instance(&global_instances, instanceId)) != NULL) {
            snprintf(instance->ncnet.publicIp, 24, "%s", publicIp);
            save_instance_struct(instance);
        }
        copy_instances();
    }
    sem_v(inst_sem);

    return EUCA_OK;
}