virsh: split out virsh-nodedev.c

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.
This commit is contained in:
Eric Blake
2012-08-21 00:05:53 -06:00
parent dcff981a70
commit ea3cf921f2
5 changed files with 57 additions and 8 deletions
+6
View File
@@ -296,6 +296,12 @@ typedef enum {
VSH_BYMAC = (1 << 4),
} vshLookupByFlags;
/* Given an index, return either the name of that device (non-NULL) or
* of its parent (NULL if a root). */
typedef const char * (*vshTreeLookup)(int devid, bool parent, void *opaque);
int vshTreePrint(vshControl *ctl, vshTreeLookup lookup, void *opaque,
int num_devices, int devid);
void vshPrintExtra(vshControl *ctl, const char *format, ...)
ATTRIBUTE_FMT_PRINTF(2, 3);
void vshDebug(vshControl *ctl, int level, const char *format, ...)