#include "qemu/help-texts.h"
#include "qemu-version.h"
+#include "qemu/cutils.h"
#include "qemu/config-file.h"
#include "qemu/error-report.h"
#include "qemu/help_option.h"
+#include "qemu/job.h"
#include "qemu/log.h"
#include "qemu/main-loop.h"
#include "qemu/module.h"
#include "trace/control.h"
static const char *pid_file;
+static char *pid_file_realpath;
static volatile bool exit_requested = false;
void qemu_system_killed(int signal, pid_t pid)
" vhost-user-blk device over file descriptor\n"
"\n"
#endif /* CONFIG_VHOST_USER_BLK_SERVER */
+#ifdef CONFIG_VDUSE_BLK_EXPORT
+" --export [type=]vduse-blk,id=<id>,node-name=<node-name>\n"
+" ,name=<vduse-name>[,writable=on|off]\n"
+" [,num-queues=<num-queues>][,queue-size=<queue-size>]\n"
+" [,logical-block-size=<logical-block-size>]\n"
+" [,serial=<serial-number>]\n"
+" export the specified block node as a\n"
+" vduse-blk device\n"
+"\n"
+#endif /* CONFIG_VDUSE_BLK_EXPORT */
" --monitor [chardev=]name[,mode=control][,pretty[=on|off]]\n"
" configure a QMP monitor\n"
"\n"
}
case OPTION_DAEMONIZE:
if (os_set_daemonize(true) < 0) {
- error_report("--daemonize not supported in this build");
+ /*
+ * --daemonize is parsed before monitor_init_globals(), so
+ * error_report() does not work yet
+ */
+ fprintf(stderr, "--daemonize not supported in this build\n");
exit(EXIT_FAILURE);
}
break;
static void pid_file_cleanup(void)
{
- unlink(pid_file);
+ unlink(pid_file_realpath);
}
static void pid_file_init(void)
exit(EXIT_FAILURE);
}
+ pid_file_realpath = g_malloc(PATH_MAX);
+ if (!realpath(pid_file, pid_file_realpath)) {
+ error_report("cannot resolve PID file path: %s: %s",
+ pid_file, strerror(errno));
+ unlink(pid_file);
+ exit(EXIT_FAILURE);
+ }
+
atexit(pid_file_cleanup);
}
qemu_add_opts(&qemu_trace_opts);
qcrypto_init(&error_fatal);
bdrv_init();
- monitor_init_globals_core();
+ monitor_init_globals();
init_qmp_commands();
if (!trace_init_backends()) {