提交 c0dbd5f3 编写于 作者: E Eric Blake

virsh: split out virsh-snapshot.c

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.
上级 9cbb0eda
...@@ -115,8 +115,8 @@ virsh_SOURCES = \ ...@@ -115,8 +115,8 @@ virsh_SOURCES = \
virsh-nwfilter.c virsh-nwfilter.h \ virsh-nwfilter.c virsh-nwfilter.h \
virsh-pool.c virsh-pool.h \ virsh-pool.c virsh-pool.h \
virsh-secret.c virsh-secret.h \ virsh-secret.c virsh-secret.h \
virsh-snapshot.c virsh-snapshot.h \
$(NULL) $(NULL)
# virsh-snapshot.c virsh-snapshot.h \
# virsh-volume.c virsh-volume.h \ # virsh-volume.c virsh-volume.h \
# #
......
/* /*
* virsh-domain.c: Commands to manage domain snapshot * virsh-snapshot.c: Commands to manage domain snapshot
* *
* Copyright (C) 2005, 2007-2012 Red Hat, Inc. * Copyright (C) 2005, 2007-2012 Red Hat, Inc.
* *
...@@ -23,6 +23,23 @@ ...@@ -23,6 +23,23 @@
* *
*/ */
#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 */ /* Helper for snapshot-create and snapshot-create-as */
static bool static bool
vshSnapshotCreate(vshControl *ctl, virDomainPtr dom, const char *buffer, vshSnapshotCreate(vshControl *ctl, virDomainPtr dom, const char *buffer,
...@@ -1597,7 +1614,7 @@ cleanup: ...@@ -1597,7 +1614,7 @@ cleanup:
return ret; return ret;
} }
static const vshCmdDef snapshotCmds[] = { const vshCmdDef snapshotCmds[] = {
{"snapshot-create", cmdSnapshotCreate, opts_snapshot_create, {"snapshot-create", cmdSnapshotCreate, opts_snapshot_create,
info_snapshot_create, 0}, info_snapshot_create, 0},
{"snapshot-create-as", cmdSnapshotCreateAs, opts_snapshot_create_as, {"snapshot-create-as", cmdSnapshotCreateAs, opts_snapshot_create_as,
......
/*
* 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 */
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
#include "virsh-nwfilter.h" #include "virsh-nwfilter.h"
#include "virsh-pool.h" #include "virsh-pool.h"
#include "virsh-secret.h" #include "virsh-secret.h"
#include "virsh-snapshot.h"
static char *progname; static char *progname;
...@@ -2817,7 +2818,6 @@ vshParseArgv(vshControl *ctl, int argc, char **argv) ...@@ -2817,7 +2818,6 @@ vshParseArgv(vshControl *ctl, int argc, char **argv)
return true; return true;
} }
#include "virsh-snapshot.c"
#include "virsh-volume.c" #include "virsh-volume.c"
static const vshCmdDef virshCmds[] = { static const vshCmdDef virshCmds[] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部