aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-08-20 17:14:37 -0600
committerEric Blake <eblake@redhat.com>2012-08-21 00:16:35 -0600
commit9cbb0eda927cdd3a7865a7877b64d96a4746b899 (patch)
tree4accd3b60c5bf5e8ce9078555332a78c49cc2abc /tools
parentvirsh: split out virsh-pool.c (diff)
downloadlibvirt-9cbb0eda927cdd3a7865a7877b64d96a4746b899.tar.gz
libvirt-9cbb0eda927cdd3a7865a7877b64d96a4746b899.tar.bz2
libvirt-9cbb0eda927cdd3a7865a7877b64d96a4746b899.zip
virsh: split out virsh-secret.c
One of the simpler splits. * tools/virsh-secret.h: New file. * tools/Makefile.am (virsh_SOURCES): Build it. * tools/virsh.c: Use new header. * tools/virsh-secret.c: Likewise.
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile.am2
-rw-r--r--tools/virsh-secret.c17
-rw-r--r--tools/virsh-secret.h33
-rw-r--r--tools/virsh.c2
4 files changed, 51 insertions, 3 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 5f4e529dd..a7350221b 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -114,8 +114,8 @@ virsh_SOURCES = \
virsh-nodedev.c virsh-nodedev.h \
virsh-nwfilter.c virsh-nwfilter.h \
virsh-pool.c virsh-pool.h \
+ virsh-secret.c virsh-secret.h \
$(NULL)
-# virsh-secret.c virsh-secret.h \
# virsh-snapshot.c virsh-snapshot.h \
# virsh-volume.c virsh-volume.h \
#
diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c
index 6f971dac4..7247eee1e 100644
--- a/tools/virsh-secret.c
+++ b/tools/virsh-secret.c
@@ -23,6 +23,21 @@
*
*/
+#include <config.h>
+#include "virsh-secret.h"
+
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
+#include <libxml/xmlsave.h>
+
+#include "internal.h"
+#include "base64.h"
+#include "buf.h"
+#include "memory.h"
+#include "util.h"
+#include "xml.h"
+
static virSecretPtr
vshCommandOptSecret(vshControl *ctl, const vshCmd *cmd, const char **name)
{
@@ -357,7 +372,7 @@ cmdSecretList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
return true;
}
-static const vshCmdDef secretCmds[] = {
+const vshCmdDef secretCmds[] = {
{"secret-define", cmdSecretDefine, opts_secret_define,
info_secret_define, 0},
{"secret-dumpxml", cmdSecretDumpXML, opts_secret_dumpxml,
diff --git a/tools/virsh-secret.h b/tools/virsh-secret.h
new file mode 100644
index 000000000..6ecb9210d
--- /dev/null
+++ b/tools/virsh-secret.h
@@ -0,0 +1,33 @@
+/*
+ * virsh-secret.h: Commands to manage secret
+ *
+ * Copyright (C) 2005, 2007-2012 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/>.
+ *
+ * Daniel Veillard <veillard@redhat.com>
+ * Karel Zak <kzak@redhat.com>
+ * Daniel P. Berrange <berrange@redhat.com>
+ *
+ */
+
+#ifndef VIRSH_SECRET_H
+# define VIRSH_SECRET_H
+
+# include "virsh.h"
+
+extern const vshCmdDef secretCmds[];
+
+#endif /* VIRSH_SECRET_H */
diff --git a/tools/virsh.c b/tools/virsh.c
index 96b31f0b6..a9745d7b3 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -82,6 +82,7 @@
#include "virsh-nodedev.h"
#include "virsh-nwfilter.h"
#include "virsh-pool.h"
+#include "virsh-secret.h"
static char *progname;
@@ -2816,7 +2817,6 @@ vshParseArgv(vshControl *ctl, int argc, char **argv)
return true;
}
-#include "virsh-secret.c"
#include "virsh-snapshot.c"
#include "virsh-volume.c"