]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: split out virsh-snapshot.c
authorEric Blake <eblake@redhat.com>
Mon, 20 Aug 2012 23:29:03 +0000 (17:29 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 21 Aug 2012 06:19:10 +0000 (00:19 -0600)
Almost done with the splits.

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

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

index a7350221b6cbc152eb363013fc98ea89ebaba8cf..3cdebab252a1b0df06489a7ea6c92522dbfd4ea2 100644 (file)
@@ -115,8 +115,8 @@ virsh_SOURCES =                                                     \
                virsh-nwfilter.c virsh-nwfilter.h               \
                virsh-pool.c virsh-pool.h                       \
                virsh-secret.c virsh-secret.h                   \
+               virsh-snapshot.c virsh-snapshot.h               \
                $(NULL)
-#              virsh-snapshot.c virsh-snapshot.h               \
 #              virsh-volume.c virsh-volume.h                   \
 #
 
index c480d1b9db3ec4222b514334d38fec67d0a966cb..aff91d3a8bc0ad7776c52e02eea96af6d72752e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * virsh-domain.c: Commands to manage domain snapshot
+ * virsh-snapshot.c: Commands to manage domain snapshot
  *
  * Copyright (C) 2005, 2007-2012 Red Hat, Inc.
  *
  *
  */
 
+#include <config.h>
+#include "virsh-snapshot.h"
+
+#include <assert.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 "virsh-domain.h"
+#include "xml.h"
+
 /* Helper for snapshot-create and snapshot-create-as */
 static bool
 vshSnapshotCreate(vshControl *ctl, virDomainPtr dom, const char *buffer,
@@ -1597,7 +1614,7 @@ cleanup:
     return ret;
 }
 
-static const vshCmdDef snapshotCmds[] = {
+const vshCmdDef snapshotCmds[] = {
     {"snapshot-create", cmdSnapshotCreate, opts_snapshot_create,
      info_snapshot_create, 0},
     {"snapshot-create-as", cmdSnapshotCreateAs, opts_snapshot_create_as,
diff --git a/tools/virsh-snapshot.h b/tools/virsh-snapshot.h
new file mode 100644 (file)
index 0000000..97e7811
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * virsh-snapshot.h: Commands to manage domain snapshot
+ *
+ * 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_SNAPSHOT_H
+# define VIRSH_SNAPSHOT_H
+
+# include "virsh.h"
+
+extern const vshCmdDef snapshotCmds[];
+
+#endif /* VIRSH_SNAPSHOT_H */
index a9745d7b32259f6219a83cb0670dd8ed57d6a002..8cbdd3e848790297c64659b158b22600cbb5579e 100644 (file)
@@ -83,6 +83,7 @@
 #include "virsh-nwfilter.h"
 #include "virsh-pool.h"
 #include "virsh-secret.h"
+#include "virsh-snapshot.h"
 
 static char *progname;
 
@@ -2817,7 +2818,6 @@ vshParseArgv(vshControl *ctl, int argc, char **argv)
     return true;
 }
 
-#include "virsh-snapshot.c"
 #include "virsh-volume.c"
 
 static const vshCmdDef virshCmds[] = {