Another worthwhile split, needed one more public function.
* tools/virsh-nodedev.h: New file.
* tools/Makefile.am (virsh_SOURCES): Build it.
* tools/virsh-nodedev.c: Use new header.
* tools/virsh.c: Likewise.
(vshTreePrint): Export.
* tools/virsh.h (vshTreePrint): Declare.
virsh-host.c virsh-host.h \
virsh-interface.c virsh-interface.h \
virsh-network.c virsh-network.h \
+ virsh-nodedev.c virsh-nodedev.h \
$(NULL)
-# virsh-nodedev.c virsh-nodedev.h \
# virsh-nwfilter.c virsh-nwfilter.h \
# virsh-pool.c virsh-pool.h \
# virsh-secret.c virsh-secret.h \
*
*/
+#include <config.h>
+#include "virsh-nodedev.h"
+
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
+#include <libxml/xmlsave.h>
+
+#include "internal.h"
+#include "buf.h"
+#include "memory.h"
+#include "util.h"
+#include "xml.h"
+
/*
* "nodedev-create" command
*/
return ret;
}
-static const vshCmdDef nodedevCmds[] = {
+const vshCmdDef nodedevCmds[] = {
{"nodedev-create", cmdNodeDeviceCreate, opts_node_device_create,
info_node_device_create, 0},
{"nodedev-destroy", cmdNodeDeviceDestroy, opts_node_device_destroy,
--- /dev/null
+/*
+ * virsh-nodedev.h: Commands in node device group
+ *
+ * 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_NODEDEV_H
+# define VIRSH_NODEDEV_H
+
+# include "virsh.h"
+
+extern const vshCmdDef nodedevCmds[];
+
+#endif /* VIRSH_NODEDEV_H */
#include "virsh-host.h"
#include "virsh-interface.h"
#include "virsh-network.h"
+#include "virsh-nodedev.h"
static char *progname;
/* Tree listing helpers. */
-/* Given an index, return either the name of that device (non-NULL) or
- * of its parent (NULL if a root). */
-typedef const char * (*vshTreeLookup)(int devid, bool parent, void *opaque);
-
static int
vshTreePrintInternal(vshControl *ctl,
vshTreeLookup lookup,
return ret;
}
-static int
+int
vshTreePrint(vshControl *ctl, vshTreeLookup lookup, void *opaque,
int num_devices, int devid)
{
return true;
}
-#include "virsh-nodedev.c"
#include "virsh-nwfilter.c"
#include "virsh-pool.c"
#include "virsh-secret.c"
VSH_BYMAC = (1 << 4),
} vshLookupByFlags;
+/* Given an index, return either the name of that device (non-NULL) or
+ * of its parent (NULL if a root). */
+typedef const char * (*vshTreeLookup)(int devid, bool parent, void *opaque);
+int vshTreePrint(vshControl *ctl, vshTreeLookup lookup, void *opaque,
+ int num_devices, int devid);
+
void vshPrintExtra(vshControl *ctl, const char *format, ...)
ATTRIBUTE_FMT_PRINTF(2, 3);
void vshDebug(vshControl *ctl, int level, const char *format, ...)