- 17 9月, 2012 1 次提交
-
-
由 Osier Yang 提交于
This improve helper vshStringToArray to accept const string as argument instead. To not convert the const string when using vshStringToArray, and thus avoid motifying it.
-
- 06 9月, 2012 2 次提交
-
-
由 Osier Yang 提交于
Move definition of MATCH from virsh-domain-monitor.c into virsh.h, and rename it as VSH_MATCH for further use. * tools/virsh-domain-monitor.c: Change MATCH into VSH_MATCH * tools/virsh.h: Define VSH_MATCH
-
由 Osier Yang 提交于
tools/virsh.c: New helper function vshStringToArray. tools/virsh.h: Declare vshStringToArray. tools/virsh-domain.c: use the helper in cmdUndefine.
-
- 31 8月, 2012 1 次提交
-
-
由 Peter Krempa 提交于
Now that vshCommandRun() checks for the connection automaticaly, remove all of the redundant checks in the code. vshConnectionUsability() no longer needs to be exported and this patch marks it static.
-
- 21 8月, 2012 3 次提交
-
-
由 Eric Blake 提交于
Another worthwhile split, needed one more public function. * tools/virsh-nodedev.h: New file. * tools/Makefile.am (virsh_SOURCES): Build it. * tools/virsh-nodedev.c: Use new header. * tools/virsh.c: Likewise. (vshTreePrint): Export. * tools/virsh.h (vshTreePrint): Declare.
-
由 Eric Blake 提交于
In preparation for splitting virsh-interface.c, I found these functions need to be declared in virsh.h, as well as one that belongs more properly in virsh-domain.h. Also, since we use the VSH_BY* flags in more than one function, I improved how they are used. * tools/virsh.h (vshNameSorter, vshCmdHasOption): Declare. (VSH_BYID): Turn into enum. (vshCommandOptDomainBy): Move... * tools/virsh-domain.h): ...here. * tools/virsh.c: (vshNameSorter): Export. (cmd_has_option): Rename... (vshCmdHasOption): ...and export. (vshCommandOptDomainBy): Move... * tools/virsh-domain.c (vshCommandOptDomainBy): ...here, adjust signature, and check flags. * tools/virsh-network.c (vshCommandOptNetworkBy): Update callers. * tools/virsh-nwfilter.c (vshCommandOptNWFilterBy): Likewise. * tools/virsh-secret.c (vshCommandOptSecret): Likewise. * tools/virsh-domain-monitor.c (includes): Likewise. * tools/virsh-host.c (includes): Likewise.
-
由 Eric Blake 提交于
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.
-
- 20 8月, 2012 2 次提交
-
-
由 Eric Blake 提交于
Convert the exported items in virsh.h to use a common 'vsh' prefix. * tools/virsh.h (VIRSH_MAX_XML_FILE): Rename... (VSH_MAX_XML_FILE): ...and parenthesize. (DIFF_MSEC, CTRL_CLOSE_BRACKET): Delete. (vshUsage, vshInit, vshDeinit, vshParseArgv): Remove prototype. (editWriteToTempFile, editFile, editReadBackFile, prettyCapacity) (virshReportError): Rename... (vshEditWriteToTempFile, vshEditFile, vshEditReadBackFile) (vshPrettyCapacity, vshReportError): ...into vsh namespace. (jobWatchTimeoutFunc): Move to virsh-domain.c. * tools/virsh.c (vshCommandRun): Inline former DIFF_MSEC. (main): Inline former CTRL_CLOSE_BRACKET. (vshUsage, vshInit, vshDeinit, vshParseArgv): Make static. (prettyCapacity, virshReportError, editWriteToTempFile, editFile): Fix naming, and adjust usage. (vshAskReedit, vshCommandRun, vshEventLoop, vshInit): Adjust usage. * tools/virsh-domain.c (cmdAttachDevice, cmdCPUCompare) (cmdCPUBaseline, cmdCreate, cmdDefine, cmdDetachDevice) (cmdUpdateDevice, cmdDesc, cmdUndefine, cmdStart, cmdVcpucount) (cmdAttachDevice, cmdDomjobinfo): Likewise. * tools/virsh-edit.c (do): Likewise. * tools/virsh-interface.c (cmdInterfaceDefine): Likewise. * tools/virsh-network.c (cmdNetworkCreate, cmdNetworkDefine): Likewise. * tools/virsh-nodedev.c (cmdNodeDeviceCreate): Likewise. * tools/virsh-nwfilter.c (cmdNWFilterDefine): Likewise. * tools/virsh-pool.c (cmdPoolCreate, cmdPoolDefine) (cmdPoolDiscoverSources, cmdPoolList): Likewise. * tools/virsh-secret.c (cmdSecretDefine): Likewise. * tools/virsh-snapshot.c (cmdSnapshotCreate, vshSnapshotCreate) (vshLookupSnapshot, cmdSnapshotEdit, cmdSnapshotCurrent) (vshGetSnapshotParent): Likewise. * tools/virsh-volume.c (cmdVolCreate, cmdVolCreateFrom) (cmdVolInfo, cmdVolList): Likewise.
-
由 Daniel P. Berrange 提交于
* cfg.mk: Whitelist virsh.h instead of virsh.c for strcasecmp check * tools/virsh-domain.h, tools/virsh.h: Fix #define indentation
-
- 18 8月, 2012 3 次提交
-
-
由 Eric Blake 提交于
C99 says that __foo naming is reserved for the compiler. Besides, we had several different styles in use; this consolidates things to set up the typedefs up front then declare the types with consistent naming. * tools/virsh.h: Use consistent struct naming. * tools/virsh.c (_vshCommandParser): Likewise.
-
由 Eric Blake 提交于
The virsh-domain.c file was pretty self-contained; the only entry point was the table of command definitions. The bulk of this patch is making more functions in virsh.c reusable. A later patch will clean up poor naming choices. * tools/Makefile.am (virsh_SOURCES): Build virsh-domain.c. * tools/virsh-domain.h: New file. * tools/virsh.h (virshReportError, vshResetLibvirtError) (vshAskReedit, vshStreamSink): Declare. * tools/virsh.c: Switch from using .c to .h. (virshReportError, vshResetLibvirtError, vshAskReedit) (vshStreamSink, prettyCapacity): Export. (vshCatchInt): Move... * tools/virsh-domain.c: ...into sole user. Use header.
-
由 Eric Blake 提交于
Having one .c file include another does not give any compilation benefits; move towards modular .o files by first splitting out reused declarations into a new virsh.h. This patch doesn't try very hard to see which functions are used or not, to make it easier to review the file split. Future patches can further trim the header to be smaller. * tools/Makefile.am (virsh_SOURCES): List new file, and prepare for others. * tools/virsh.c: Split declarations... * tools/virsh.h: ...into new file, and make several functions non-static. * tools/virsh-domain-monitor.c (vshGetDomainDescription): Make non-static.
-