]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: split out virsh-domain-monitor.c
authorEric Blake <eblake@redhat.com>
Mon, 20 Aug 2012 13:46:38 +0000 (07:46 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 21 Aug 2012 05:39:54 +0000 (23:39 -0600)
Another file worth compiling on its own instead of by .c inclusion.

* tools/virsh-domain-monitor.h: New file.
* tools/Makefile.am (virsh_SOURCES): Build it.
* tools/virsh.h (vshGetDomainDescription): Move to correct
header.
* tools/virsh-domain-monitor.c: Use new header.
* tools/virsh.c: Likewise.
* tools/virsh-domain.c: Likewise.

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

index b8858920cca226c4cd1045dde3a75b6d45ce671a..6b066f63bc082a9d2748f1f6630aba1df4006e93 100644 (file)
@@ -107,8 +107,8 @@ virsh_SOURCES =                                                     \
                console.c console.h                             \
                virsh.c virsh.h                                 \
                virsh-domain.c virsh-domain.h                   \
+               virsh-domain-monitor.c virsh-domain-monitor.h   \
                $(NULL)
-#              virsh-domain-monitor.c virsh-domain-monitor.h   \
 #              virsh-host.c virsh-host.h                       \
 #              virsh-interface.c virsh-interface.h             \
 #              virsh-network.c virsh-network.h                 \
index 52e44c9275b64332a44fa57c8c8efae23762523e..4f00e658677ae528e910fc6abe88f9b54e63228d 100644 (file)
  *
  */
 
+#include <config.h>
+#include "virsh-domain-monitor.h"
+
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
+#include <libxml/xmlsave.h>
+
+#include "internal.h"
+#include "conf/domain_conf.h"
 #include "intprops.h"
+#include "memory.h"
+#include "virmacaddr.h"
+#include "xml.h"
 
 static const char *
 vshDomainIOErrorToString(int error)
@@ -1683,7 +1696,7 @@ cleanup:
 }
 #undef FILTER
 
-static const vshCmdDef domMonitoringCmds[] = {
+const vshCmdDef domMonitoringCmds[] = {
     {"domblkerror", cmdDomBlkError, opts_domblkerror, info_domblkerror, 0},
     {"domblkinfo", cmdDomblkinfo, opts_domblkinfo, info_domblkinfo, 0},
     {"domblklist", cmdDomblklist, opts_domblklist, info_domblklist, 0},
diff --git a/tools/virsh-domain-monitor.h b/tools/virsh-domain-monitor.h
new file mode 100644 (file)
index 0000000..e322006
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * virsh-domain-monitor.h: Commands to monitor domain status
+ *
+ * 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_DOMAIN_MONITOR_H
+# define VIRSH_DOMAIN_MONITOR_H
+
+# include "virsh.h"
+
+char *vshGetDomainDescription(vshControl *ctl, virDomainPtr dom,
+                              bool title, unsigned int flags)
+    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+
+extern const vshCmdDef domMonitoringCmds[];
+
+#endif /* VIRSH_DOMAIN_MONITOR_H */
index 94ac1aa886b9ba16c229291f275e271d41f90441..e949dcffabb77c07e6070a55c9cd35d0bbbedf0d 100644 (file)
@@ -48,6 +48,7 @@
 #include "virfile.h"
 #include "virkeycode.h"
 #include "virmacaddr.h"
+#include "virsh-domain-monitor.h"
 #include "virterror_internal.h"
 #include "virtypedparam.h"
 #include "xml.h"
index 904ff33ccb0923edad54fd450d20ff6169d27d89..fb1af42b9d75e8041882609323f4c5c618dcf479 100644 (file)
@@ -75,6 +75,7 @@
 #include "virtypedparam.h"
 
 #include "virsh-domain.h"
+#include "virsh-domain-monitor.h"
 
 static char *progname;
 
@@ -2861,7 +2862,6 @@ vshParseArgv(vshControl *ctl, int argc, char **argv)
     return true;
 }
 
-#include "virsh-domain-monitor.c"
 #include "virsh-host.c"
 #include "virsh-interface.c"
 #include "virsh-network.c"
index 764369e982542dc2a8abe54b2bc9a1e9155ff0f7..24d2020f415e89c91c108b004b8513f4521f87d0 100644 (file)
@@ -286,9 +286,6 @@ int vshCommandOptScaledInt(const vshCmd *cmd, const char *name,
 bool vshCommandOptBool(const vshCmd *cmd, const char *name);
 const vshCmdOpt *vshCommandOptArgv(const vshCmd *cmd,
                                    const vshCmdOpt *opt);
-char *vshGetDomainDescription(vshControl *ctl, virDomainPtr dom,
-                              bool title, unsigned int flags)
-    ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
 
 # define VSH_BYID     (1 << 1)
 # define VSH_BYUUID   (1 << 2)