The guest handle field start_t was previously used (when we
had the wait_ready call), but had fallen into disuse. Note
that it could never be accessed through the API.
Rename this field as launch_t, convert it to a timeval, and
use it to measure the time since guestfs_launch was called
so that we can start profiling guest launch.
int sock; /* Daemon communications socket. */
pid_t pid; /* Qemu PID. */
pid_t recoverypid; /* Recovery process PID. */
int sock; /* Daemon communications socket. */
pid_t pid; /* Qemu PID. */
pid_t recoverypid; /* Recovery process PID. */
- time_t start_t; /* The time when we started qemu. */
+
+ struct timeval launch_t; /* The time that we called guestfs_launch. */
char *tmpdir; /* Temporary directory containing socket. */
char *tmpdir; /* Temporary directory containing socket. */
char unixsock[256];
struct sockaddr_un addr;
char unixsock[256];
struct sockaddr_un addr;
+ /* Start the clock ... */
+ gettimeofday (&g->launch_t, NULL);
+
#ifdef P_tmpdir
tmpdir = P_tmpdir;
#else
#ifdef P_tmpdir
tmpdir = P_tmpdir;
#else
- /* Start the clock ... */
- time (&g->start_t);
-
if (!g->direct) {
/* Close the other ends of the pipe. */
close (wfd[0]);
if (!g->direct) {
/* Close the other ends of the pipe. */
close (wfd[0]);
g->fd[1] = -1;
g->pid = 0;
g->recoverypid = 0;
g->fd[1] = -1;
g->pid = 0;
g->recoverypid = 0;
+ memset (&g->launch_t, 0, sizeof g->launch_t);
cleanup0:
if (g->sock >= 0) {
cleanup0:
if (g->sock >= 0) {
g->sock = -1;
g->pid = 0;
g->recoverypid = 0;
g->sock = -1;
g->pid = 0;
g->recoverypid = 0;
+ memset (&g->launch_t, 0, sizeof g->launch_t);
g->state = CONFIG;
if (g->subprocess_quit_cb)
g->subprocess_quit_cb (g, g->subprocess_quit_cb_data);
g->state = CONFIG;
if (g->subprocess_quit_cb)
g->subprocess_quit_cb (g, g->subprocess_quit_cb_data);