summaryrefslogtreecommitdiffstats
path: root/df/virt-df.h
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-11-23 12:05:04 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-11-25 18:58:13 +0000
commit18374b5b7d3154e0b8b8a07e3590f6eee762b58e (patch)
tree13a8254ab4e06a1736761005866fc313182b8e58 /df/virt-df.h
parent4838ec3326d2970e6afe3cde6b368aeae840b969 (diff)
downloadlibguestfs-18374b5b7d3154e0b8b8a07e3590f6eee762b58e.tar.gz
libguestfs-18374b5b7d3154e0b8b8a07e3590f6eee762b58e.tar.xz
libguestfs-18374b5b7d3154e0b8b8a07e3590f6eee762b58e.zip
df: Rewrite virt-df in C.
I have diffed the output from the original virt-df with this new version, and they agree very closely. Some differences: - Old virt-df have a divide-by-zero error in cases where the number of used inodes was 0. New virt-df fixes this. - New virt-df uses gnulib human_readable library which displays numbers to 3 significant figures for -h output (old version used an ad hoc function).
Diffstat (limited to 'df/virt-df.h')
-rw-r--r--df/virt-df.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/df/virt-df.h b/df/virt-df.h
new file mode 100644
index 00000000..4a3179ef
--- /dev/null
+++ b/df/virt-df.h
@@ -0,0 +1,42 @@
+/* virt-df
+ * Copyright (C) 2010 Red Hat Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef GUESTFS_VIRT_DF_
+#define GUESTFS_VIRT_DF_
+
+extern guestfs_h *g;
+extern const char *libvirt_uri; /* --connect */
+extern int csv; /* --csv */
+extern int human; /* --human-readable|-h */
+extern int inodes; /* --inodes */
+extern int one_per_guest; /* --one-per-guest */
+extern int uuid; /* --uuid */
+
+/* df.c */
+extern int df_on_handle (const char *name, const char *uuid, char **devices, int offset);
+
+/* domains.c */
+#ifdef HAVE_LIBVIRT
+extern void get_domains_from_libvirt (void);
+#endif
+
+/* output.c */
+extern void print_title (void);
+extern void print_stat (const char *name, const char *uuid, const char *dev, int offset, const struct guestfs_statvfs *stat);
+
+#endif /* GUESTFS_VIRT_DF_ */