From ae8e89fb1202d016713337ff94ffeec81127c45b Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 20 Aug 2012 14:01:45 -0600 Subject: [PATCH] virsh: split out virsh-host.c 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 | 2 +- tools/virsh-host.c | 16 +++++++++++++++- tools/virsh-host.h | 33 +++++++++++++++++++++++++++++++++ tools/virsh.c | 2 +- 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 tools/virsh-host.h diff --git a/tools/Makefile.am b/tools/Makefile.am index 6b066f63bc..a3e5ff4d19 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -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 \ diff --git a/tools/virsh-host.c b/tools/virsh-host.c index b09d9f9d86..e3cff8ede8 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -23,6 +23,20 @@ * */ +#include +#include "virsh-host.h" + +#include +#include +#include +#include + +#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 index 0000000000..8242f91a25 --- /dev/null +++ b/tools/virsh-host.h @@ -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 + * . + * + * Daniel Veillard + * Karel Zak + * Daniel P. Berrange + * + */ + +#ifndef VIRSH_HOST_H +# define VIRSH_HOST_H + +# include "virsh.h" + +extern const vshCmdDef hostAndHypervisorCmds[]; + +#endif /* VIRSH_HOST_H */ diff --git a/tools/virsh.c b/tools/virsh.c index fb1af42b9d..793a357bd1 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -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"