libvirt/src/conf/secret_conf.h
John Ferlan 13350a17e4 conf: Add new secret type "tls"
Add a new secret usage type known as "tls" - it will handle adding the
secret objects for various TLS objects that need to provide some sort
of passphrase in order to access the credentials.

The format is:

   <secret ephemeral='no' private='no'>
     <description>Sample TLS secret</description>
     <usage type='tls'>
       <name>mumblyfratz</name>
     </usage>
</secret>

Once defined and a passphrase set, future patches will allow the UUID
to be set in the qemu.conf file and thus used as a secret for various
TLS options such as a chardev serial TCP connection, a NBD client/server
connection, and migration.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2016-09-09 08:20:05 -04:00

68 lines
2.2 KiB
C

/*
* secret_conf.h: internal <secret> XML handling API
*
* Copyright (C) 2009-2010, 2013-2014, 2016 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
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Red Hat Author: Miloslav Trmač <mitr@redhat.com>
*/
#ifndef __VIR_SECRET_CONF_H__
# define __VIR_SECRET_CONF_H__
# include "internal.h"
# include "virutil.h"
VIR_ENUM_DECL(virSecretUsage)
typedef struct _virSecretDef virSecretDef;
typedef virSecretDef *virSecretDefPtr;
struct _virSecretDef {
bool isephemeral;
bool isprivate;
unsigned char uuid[VIR_UUID_BUFLEN];
char *description; /* May be NULL */
int usage_type; /* virSecretUsageType */
union {
char *volume; /* May be NULL */
char *ceph;
char *target;
char *name;
} usage;
};
const char *virSecretUsageIDForDef(virSecretDefPtr def);
void virSecretDefFree(virSecretDefPtr def);
virSecretDefPtr virSecretDefParseString(const char *xml);
virSecretDefPtr virSecretDefParseFile(const char *filename);
char *virSecretDefFormat(const virSecretDef *def);
# define VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL \
(VIR_CONNECT_LIST_SECRETS_EPHEMERAL | \
VIR_CONNECT_LIST_SECRETS_NO_EPHEMERAL)
# define VIR_CONNECT_LIST_SECRETS_FILTERS_PRIVATE \
(VIR_CONNECT_LIST_SECRETS_PRIVATE | \
VIR_CONNECT_LIST_SECRETS_NO_PRIVATE)
# define VIR_CONNECT_LIST_SECRETS_FILTERS_ALL \
(VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL | \
VIR_CONNECT_LIST_SECRETS_FILTERS_PRIVATE)
#endif