static int doCancelBundleTask(struct nc_state_t *nc, ncMetadata * pMeta, char *instanceId)
{
    ncInstance *instance = find_instance(&global_instances, instanceId);
    if (instance == NULL) {
        LOGERROR("[%s] instance not found\n", instanceId);
        return EUCA_NOT_FOUND_ERROR;
    }

    instance->bundleCanceled = 1;      // record the intent to cancel bundling so that bundling thread can abort
    if ((instance->bundlePid > 0) && !check_process(instance->bundlePid, "euca-bundle-upload")) {
        LOGDEBUG("[%s] found bundlePid '%d', sending kill signal...\n", instanceId, instance->bundlePid);
        kill(instance->bundlePid, 9);
        instance->bundlePid = 0;
    }

    return (EUCA_OK);
}
static int doCancelBundleTask(struct nc_state_t *nc, ncMetadata * pMeta, char *instanceId)
{
    ncInstance *instance = find_instance(&global_instances, instanceId);
    if (instance == NULL) {
        LOGERROR("[%s] instance not found\n", instanceId);
        return EUCA_NOT_FOUND_ERROR;
    }

    instance->bundleCanceled = 1;       
    if ((instance->bundlePid > 0) && !check_process(instance->bundlePid, "euca-bundle-upload")) {
        LOGDEBUG("[%s] found bundlePid '%d', sending kill signal...\n", instanceId, instance->bundlePid);
        kill(instance->bundlePid, 9);
        instance->bundlePid = 0;
    }

    return (EUCA_OK);
}