2010-01-15 15:01:02 +00:00
|
|
|
/*
|
2010-03-02 21:19:24 +00:00
|
|
|
* esx_secret_driver.c: secret driver functions for VMware ESX secret manipulation
|
2010-01-15 15:01:02 +00:00
|
|
|
*
|
2011-07-06 20:40:19 +00:00
|
|
|
* Copyright (C) 2010-2011 Red Hat, Inc.
|
2010-01-15 15:01:02 +00:00
|
|
|
* Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
|
|
*
|
|
|
|
* 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-01-15 15:01:02 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "internal.h"
|
2012-12-12 18:06:53 +00:00
|
|
|
#include "viralloc.h"
|
2012-12-13 18:01:25 +00:00
|
|
|
#include "viruuid.h"
|
2010-01-15 15:01:02 +00:00
|
|
|
#include "esx_private.h"
|
|
|
|
#include "esx_secret_driver.h"
|
|
|
|
#include "esx_vi.h"
|
|
|
|
#include "esx_vi_methods.h"
|
|
|
|
#include "esx_util.h"
|
|
|
|
|
|
|
|
#define VIR_FROM_THIS VIR_FROM_ESX
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static virDrvOpenStatus
|
|
|
|
esxSecretOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
2011-07-06 22:14:33 +00:00
|
|
|
unsigned int flags)
|
2010-01-15 15:01:02 +00:00
|
|
|
{
|
2011-07-06 22:14:33 +00:00
|
|
|
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
|
|
|
2010-07-25 17:04:22 +00:00
|
|
|
if (conn->driver->no != VIR_DRV_ESX) {
|
2010-01-15 15:01:02 +00:00
|
|
|
return VIR_DRV_OPEN_DECLINED;
|
|
|
|
}
|
|
|
|
|
|
|
|
conn->secretPrivateData = conn->privateData;
|
|
|
|
|
|
|
|
return VIR_DRV_OPEN_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
esxSecretClose(virConnectPtr conn)
|
|
|
|
{
|
|
|
|
conn->secretPrivateData = NULL;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static virSecretDriver esxSecretDriver = {
|
2011-06-06 03:08:06 +00:00
|
|
|
.name = "ESX",
|
2013-04-23 12:49:21 +00:00
|
|
|
.secretOpen = esxSecretOpen, /* 0.7.6 */
|
|
|
|
.secretClose = esxSecretClose, /* 0.7.6 */
|
2010-01-15 15:01:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
esxSecretRegister(void)
|
|
|
|
{
|
|
|
|
return virRegisterSecretDriver(&esxSecretDriver);
|
|
|
|
}
|