]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: split out virsh-host.c
authorEric Blake <eblake@redhat.com>
Mon, 20 Aug 2012 20:01:45 +0000 (14:01 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 21 Aug 2012 05:51:29 +0000 (23:51 -0600)
The splits are getting easier, with fewer cleanups needed in virsh.h.

* tools/virsh-host.h: New file.
* tools/Makefile.am (virsh_SOURCES): Build it.
* tools/virsh-host.c: Use new header.
* tools/virsh.c: Likewise.

tools/Makefile.am
tools/virsh-host.c
tools/virsh-host.h [new file with mode: 0644]
tools/virsh.c

index 6b066f63bc082a9d2748f1f6630aba1df4006e93..a3e5ff4d198a9259e9ce0949b095619ae8103bf5 100644 (file)
@@ -108,8 +108,8 @@ virsh_SOURCES =                                                     \
                virsh.c virsh.h                                 \
                virsh-domain.c virsh-domain.h                   \
                virsh-domain-monitor.c virsh-domain-monitor.h   \
+               virsh-host.c virsh-host.h                       \
                $(NULL)
-#              virsh-host.c virsh-host.h                       \
 #              virsh-interface.c virsh-interface.h             \
 #              virsh-network.c virsh-network.h                 \
 #              virsh-nodedev.c virsh-nodedev.h                 \
index b09d9f9d862cbe5b0df9274627564564bb467928..e3cff8ede88797ff997ae2b5e591b9a965689723 100644 (file)
  *
  */
 
+#include <config.h>
+#include "virsh-host.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"
+
 /*
  * "capabilities" command
  */
@@ -819,7 +833,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
     return true;
 }
 
-static const vshCmdDef hostAndHypervisorCmds[] = {
+const vshCmdDef hostAndHypervisorCmds[] = {
     {"capabilities", cmdCapabilities, NULL, info_capabilities, 0},
     {"connect", cmdConnect, opts_connect, info_connect,
      VSH_CMD_FLAG_NOCONNECT},
diff --git a/tools/virsh-host.h b/tools/virsh-host.h
new file mode 100644 (file)
index 0000000..8242f91
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * virsh-host.h: Commands in "Host and Hypervisor" 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_HOST_H
+# define VIRSH_HOST_H
+
+# include "virsh.h"
+
+extern const vshCmdDef hostAndHypervisorCmds[];
+
+#endif /* VIRSH_HOST_H */
index fb1af42b9d75e8041882609323f4c5c618dcf479..793a357bd1c399da810d2a3591702c8422db35a7 100644 (file)
@@ -76,6 +76,7 @@
 
 #include "virsh-domain.h"
 #include "virsh-domain-monitor.h"
+#include "virsh-host.h"
 
 static char *progname;
 
@@ -2862,7 +2863,6 @@ vshParseArgv(vshControl *ctl, int argc, char **argv)
     return true;
 }
 
-#include "virsh-host.c"
 #include "virsh-interface.c"
 #include "virsh-network.c"
 #include "virsh-nodedev.c"