2010-09-13 13:02:58 +00:00
|
|
|
/*
|
|
|
|
* lock_manager.h: Defines the internal lock manager API
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010-2011 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2010-09-13 13:02:58 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-06-18 16:12:31 +00:00
|
|
|
#pragma once
|
2010-09-13 13:02:58 +00:00
|
|
|
|
2019-06-18 16:12:31 +00:00
|
|
|
#include "internal.h"
|
|
|
|
#include "lock_driver.h"
|
2010-09-13 13:02:58 +00:00
|
|
|
|
|
|
|
typedef struct _virLockManagerPlugin virLockManagerPlugin;
|
|
|
|
typedef virLockManagerPlugin *virLockManagerPluginPtr;
|
|
|
|
|
|
|
|
virLockManagerPluginPtr virLockManagerPluginNew(const char *name,
|
2012-12-11 15:59:21 +00:00
|
|
|
const char *driverName,
|
|
|
|
const char *configDir,
|
2010-09-13 13:02:58 +00:00
|
|
|
unsigned int flags);
|
|
|
|
void virLockManagerPluginRef(virLockManagerPluginPtr plugin);
|
|
|
|
void virLockManagerPluginUnref(virLockManagerPluginPtr plugin);
|
|
|
|
|
|
|
|
const char *virLockManagerPluginGetName(virLockManagerPluginPtr plugin);
|
|
|
|
bool virLockManagerPluginUsesState(virLockManagerPluginPtr plugin);
|
|
|
|
|
2011-07-06 16:15:54 +00:00
|
|
|
virLockDriverPtr virLockManagerPluginGetDriver(virLockManagerPluginPtr plugin);
|
2010-09-13 13:02:58 +00:00
|
|
|
|
2011-07-06 16:15:54 +00:00
|
|
|
virLockManagerPtr virLockManagerNew(virLockDriverPtr driver,
|
2010-09-13 13:02:58 +00:00
|
|
|
unsigned int type,
|
|
|
|
size_t nparams,
|
|
|
|
virLockManagerParamPtr params,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
int virLockManagerAddResource(virLockManagerPtr manager,
|
|
|
|
unsigned int type,
|
|
|
|
const char *name,
|
|
|
|
size_t nparams,
|
|
|
|
virLockManagerParamPtr params,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
int virLockManagerAcquire(virLockManagerPtr manager,
|
|
|
|
const char *state,
|
2011-06-24 14:14:41 +00:00
|
|
|
unsigned int flags,
|
2012-09-18 11:40:13 +00:00
|
|
|
virDomainLockFailureAction action,
|
2011-06-24 14:14:41 +00:00
|
|
|
int *fd);
|
2010-09-13 13:02:58 +00:00
|
|
|
int virLockManagerRelease(virLockManagerPtr manager,
|
|
|
|
char **state,
|
|
|
|
unsigned int flags);
|
|
|
|
int virLockManagerInquire(virLockManagerPtr manager,
|
|
|
|
char **state,
|
|
|
|
unsigned int flags);
|
|
|
|
|
|
|
|
int virLockManagerFree(virLockManagerPtr manager);
|