mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Implement xl dump-core
Implements dump-core command which is similar to xm dump-core except that it requires an additional argument which is the target filename. Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
This commit is contained in:
1 parent
9fc200ae85
commit
a9c189d680
5 files changed
+33
No files matched your search
@@ -523,6 +523,13 @@ int libxl_domain_pause(struct libxl_ctx *ctx, uint32_t domid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int libxl_domain_core_dump(struct libxl_ctx *ctx, uint32_t domid, const char *filename)
|
||||
{
|
||||
if ( xc_domain_dumpcore(ctx->xch, domid, filename) )
|
||||
return ERROR_FAIL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int libxl_domain_unpause(struct libxl_ctx *ctx, uint32_t domid)
|
||||
{
|
||||
char *path;
|
||||
|
||||
@@ -395,6 +395,8 @@ int libxl_domain_rename(struct libxl_ctx *ctx, uint32_t domid,
|
||||
int libxl_domain_pause(struct libxl_ctx *ctx, uint32_t domid);
|
||||
int libxl_domain_unpause(struct libxl_ctx *ctx, uint32_t domid);
|
||||
|
||||
int libxl_domain_core_dump(struct libxl_ctx *ctx, uint32_t domid, const char *filename);
|
||||
|
||||
int libxl_domain_setmaxmem(struct libxl_ctx *ctx, uint32_t domid, uint32_t target_memkb);
|
||||
int libxl_set_memory_target(struct libxl_ctx *ctx, uint32_t domid, uint32_t target_memkb, int enforce);
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ int main_restore(int argc, char **argv);
|
||||
int main_migrate_receive(int argc, char **argv);
|
||||
int main_save(int argc, char **argv);
|
||||
int main_migrate(int argc, char **argv);
|
||||
int main_dump_core(int argc, char **argv);
|
||||
int main_pause(int argc, char **argv);
|
||||
int main_unpause(int argc, char **argv);
|
||||
int main_destroy(int argc, char **argv);
|
||||
|
||||
@@ -2264,6 +2264,14 @@ static void migrate_domain(char *domain_spec, const char *rune,
|
||||
exit(-ERROR_BADFAIL);
|
||||
}
|
||||
|
||||
static void core_dump_domain(const char *domain_spec, const char *filename)
|
||||
{
|
||||
int rc;
|
||||
find_domain(domain_spec);
|
||||
rc=libxl_domain_core_dump(&ctx, domid, filename);
|
||||
if (rc) { fprintf(stderr,"core dump failed (rc=%d)\n.",rc);exit(-1); }
|
||||
}
|
||||
|
||||
static void migrate_receive(int debug, int daemonize)
|
||||
{
|
||||
int rc, rc2;
|
||||
@@ -2533,6 +2541,16 @@ int main_migrate(int argc, char **argv)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main_dump_core(int argc, char **argv)
|
||||
{
|
||||
if ( argc-optind < 2 ) {
|
||||
help("dump-core");
|
||||
exit(2);
|
||||
}
|
||||
core_dump_domain(argv[optind], argv[optind + 1]);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main_pause(int argc, char **argv)
|
||||
{
|
||||
int opt;
|
||||
|
||||
@@ -102,6 +102,11 @@ struct cmd_spec cmd_table[] = {
|
||||
"-e Do not wait in the background (on <host>) for the death\n"
|
||||
" of the domain."
|
||||
},
|
||||
{ "dump-core",
|
||||
&main_dump_core,
|
||||
"Core dump a domain",
|
||||
"<Domain> <filename>"
|
||||
},
|
||||
{ "restore",
|
||||
&main_restore,
|
||||
"Restore a domain from a saved state",
|
||||
|
||||