#define VIR_FROM_THIS VIR_FROM_LXC
+#define START_POSTFIX ": starting up\n"
+
#define LXC_NB_MEM_PARAM 3
typedef struct _lxcDomainObjPrivate lxcDomainObjPrivate;
char *filterstr;
char *outputstr;
virCommandPtr cmd;
+ off_t pos = -1;
+ char ebuf[1024];
+ char *timestamp;
cmd = virCommandNew(vm->def->emulator);
goto cleanup;
}
+ /* Log timestamp */
+ if ((timestamp = virTimestamp()) == NULL) {
+ virReportOOMError();
+ goto cleanup;
+ }
+ if (safewrite(logfile, timestamp, strlen(timestamp)) < 0 ||
+ safewrite(logfile, START_POSTFIX, strlen(START_POSTFIX)) < 0) {
+ VIR_WARN("Unable to write timestamp to logfile: %s",
+ virStrerror(errno, ebuf, sizeof ebuf));
+ }
+ VIR_FREE(timestamp);
+
+ /* Log generated command line */
+ virCommandWriteArgLog(cmd, logfile);
+ if ((pos = lseek(logfile, 0, SEEK_END)) < 0)
+ VIR_WARN("Unable to seek to end of logfile: %s",
+ virStrerror(errno, ebuf, sizeof ebuf));
+
virCommandPreserveFD(cmd, appPty);
virCommandSetOutputFD(cmd, &logfile);
virCommandSetErrorFD(cmd, &logfile);