} \
})
-static void create_domain(int debug, const char *config_file, const char *restore_file, int paused)
+static void create_domain(int debug, int daemonize, const char *config_file, const char *restore_file, int paused)
{
struct libxl_ctx ctx;
uint32_t domid;
if (!paused)
libxl_domain_unpause(&ctx, domid);
+ if (!daemonize)
+ exit(0);
+
if (need_daemon) {
char *fullname, *name;
printf("Options:\n\n");
printf("-h Print this help.\n");
printf("-d Enable debug messages.\n");
+ printf("-e Do not wait in the background for the death of the domain.\n");
} else if(!strcmp(command, "list")) {
printf("Usage: xl list [Domain]\n\n");
printf("List information about all/some domains.\n\n");
printf("Options:\n\n");
printf("-h Print this help.\n");
printf("-p Do not unpause domain after restoring it.\n");
+ printf("-e Do not wait in the background for the death of the domain.\n");
} else if(!strcmp(command, "destroy")) {
printf("Usage: xl destroy <Domain>\n\n");
printf("Terminate a domain immediately.\n\n");
{
char *checkpoint_file = NULL;
char *config_file = NULL;
- int paused = 0, debug = 0;
+ int paused = 0, debug = 0, daemonize = 1;
int opt;
- while ((opt = getopt(argc, argv, "hpd")) != -1) {
+ while ((opt = getopt(argc, argv, "hpde")) != -1) {
switch (opt) {
case 'p':
paused = 1;
case 'd':
debug = 1;
break;
+ case 'e':
+ daemonize = 0;
+ break;
case 'h':
help("restore");
exit(0);
config_file = argv[optind];
checkpoint_file = argv[optind + 1];
- create_domain(debug, config_file, checkpoint_file, paused);
+ create_domain(debug, daemonize, config_file, checkpoint_file, paused);
exit(0);
}
int main_create(int argc, char **argv)
{
char *filename = NULL;
- int debug = 0;
+ int debug = 0, daemonize = 1;
int opt;
- while ((opt = getopt(argc, argv, "hd")) != -1) {
+ while ((opt = getopt(argc, argv, "hde")) != -1) {
switch (opt) {
case 'd':
debug = 1;
break;
+ case 'e':
+ daemonize = 0;
+ break;
case 'h':
help("create");
exit(0);
}
filename = argv[optind];
- create_domain(debug, filename, NULL, 0);
+ create_domain(debug, daemonize, filename, NULL, 0);
exit(0);
}