dp_ptask.c revision a3c8390d19593b1e5277d95bfb4ab206d4785150
/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2013 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <tevent.h>
#include <talloc.h>
#include <time.h>
#include <string.h>
#include "providers/dp_backend.h"
#include "providers/dp_ptask.h"
enum be_ptask_schedule {
};
struct be_ptask {
struct tevent_context *ev;
enum be_ptask_offline offline;
void *pvt;
const char *name;
bool enabled;
};
enum be_ptask_schedule from);
static int be_ptask_destructor(void *pvt)
{
return 0;
}
return 0;
}
static void be_ptask_online_cb(void *pvt)
{
return;
}
}
static void be_ptask_offline_cb(void *pvt)
{
}
struct tevent_timer *tt,
void *pvt)
{
}
struct tevent_timer *tt,
void *pvt)
{
case BE_PTASK_OFFLINE_SKIP:
return;
case BE_PTASK_OFFLINE_DISABLE:
/* This case is handled by offline callback. */
return;
case BE_PTASK_OFFLINE_EXECUTE:
/* continue */
break;
}
}
/* skip this iteration and try again later */
return;
}
/* schedule timeout */
/* If we can't guarantee a timeout,
* we need to cancel the request. */
}
}
return;
}
{
switch (ret) {
case EOK:
break;
default:
break;
}
}
enum be_ptask_schedule from)
{
return;
}
switch (from) {
break;
"from last execution time [%lu]\n",
break;
}
}
/* nothing we can do about it */
}
}
enum be_ptask_offline offline,
void *pvt,
const char *name,
{
return EINVAL;
}
goto done;
}
goto done;
}
if (offline == BE_PTASK_OFFLINE_DISABLE) {
/* install offline and online callbacks */
goto done;
}
goto done;
}
}
}
done:
}
return ret;
}
{
return;
}
}
/* Disable the task, but if a request already in progress, let it finish. */
{
}
{
talloc_zfree(*task);
}
{
}
struct be_ptask_sync_ctx {
void *pvt;
};
struct be_ptask_sync_state {
int dummy;
};
/* This is not an asynchronous request so there is not any _done function. */
static struct tevent_req *
struct tevent_context *ev,
void *pvt)
{
return NULL;
}
} else {
}
return req;
}
{
return EOK;
}
enum be_ptask_offline offline,
void *pvt,
const char *name,
{
goto done;
}
goto done;
}
}
done:
}
return ret;
}