summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-04-23 19:23:52 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-04-23 19:23:52 +0100
commit012a2ec1acf7a7a2d859f78ea4932ae9fb30522d (patch)
treecf12487b5906371dc8a533fc0e78aae5222b8378
parent5f8c46db05966a6e31b696d629fd3f74e4fb6c71 (diff)
downloadlibguestfs-012a2ec1acf7a7a2d859f78ea4932ae9fb30522d.tar.gz
libguestfs-012a2ec1acf7a7a2d859f78ea4932ae9fb30522d.tar.xz
libguestfs-012a2ec1acf7a7a2d859f78ea4932ae9fb30522d.zip
Remove the 'debug mem' command, it's never going to work.
-rw-r--r--daemon/debug.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/daemon/debug.c b/daemon/debug.c
index 25fe64f1..fc105316 100644
--- a/daemon/debug.c
+++ b/daemon/debug.c
@@ -46,13 +46,11 @@ struct cmd {
static char *debug_help (const char *subcmd, int argc, char *const *const argv);
static char *debug_fds (const char *subcmd, int argc, char *const *const argv);
-static char *debug_mem (const char *subcmd, int argc, char *const *const argv);
static char *debug_sh (const char *subcmd, int argc, char *const *const argv);
static struct cmd cmds[] = {
{ "help", debug_help },
{ "fds", debug_fds },
- { "mem", debug_mem },
{ "sh", debug_sh },
{ NULL, NULL }
};
@@ -173,34 +171,6 @@ debug_fds (const char *subcmd, int argc, char *const *const argv)
return out;
}
-/* Report how much memory we can blindly allocate before
- * we get an error.
- */
-static char *
-debug_mem (const char *subcmd, int argc, char *const *const argv)
-{
- char *mem = NULL, *p;
- int size = 0;
- char *buf;
-
- for (;;) {
- size += 128 * 1024;
- p = realloc (mem, size);
- if (p == NULL) {
- free (mem);
- break;
- }
- mem = p;
- }
-
- if (asprintf (&buf, "%.1f MBytes", size / 1024.0 / 1024.0) == -1) {
- reply_with_perror ("asprintf");
- return NULL;
- }
-
- return buf; /* caller frees */
-}
-
/* Run an arbitrary shell command. */
static char *
debug_sh (const char *subcmd, int argc, char *const *const argv)