X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Flaunch.c;h=40a58e0000b9d06312ea29cc37de95fbea0f9f32;hb=913d5cd3a950a35f19581262250f58a871689d8c;hp=386d1a1795d7b1ece62e5d2a32e33ba1e7d5fbea;hpb=2f88a20d30e2a5723e8d705da00373c7848b9350;p=libguestfs.git diff --git a/src/launch.c b/src/launch.c index 386d1a1..40a58e0 100644 --- a/src/launch.c +++ b/src/launch.c @@ -1,5 +1,5 @@ /* libguestfs - * Copyright (C) 2009-2010 Red Hat Inc. + * Copyright (C) 2009-2011 Red Hat Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -71,6 +71,7 @@ #include "guestfs_protocol.h" static int launch_appliance (guestfs_h *g); +static int64_t timeval_diff (const struct timeval *x, const struct timeval *y); static int qemu_supports (guestfs_h *g, const char *option); /* Add a string to the current command line. */ @@ -382,7 +383,7 @@ launch_appliance (guestfs_h *g) { int r; int wfd[2], rfd[2]; - char unixsock[256]; + char guestfsd_sock[256]; struct sockaddr_un addr; /* At present you must add drives before starting the appliance. In @@ -411,8 +412,8 @@ launch_appliance (guestfs_h *g) /* Using virtio-serial, we need to create a local Unix domain socket * for qemu to connect to. */ - snprintf (unixsock, sizeof unixsock, "%s/sock", g->tmpdir); - unlink (unixsock); + snprintf (guestfsd_sock, sizeof guestfsd_sock, "%s/guestfsd.sock", g->tmpdir); + unlink (guestfsd_sock); g->sock = socket (AF_UNIX, SOCK_STREAM, 0); if (g->sock == -1) { @@ -426,7 +427,7 @@ launch_appliance (guestfs_h *g) } addr.sun_family = AF_UNIX; - strncpy (addr.sun_path, unixsock, UNIX_PATH_MAX); + strncpy (addr.sun_path, guestfsd_sock, UNIX_PATH_MAX); addr.sun_path[UNIX_PATH_MAX-1] = '\0'; if (bind (g->sock, &addr, sizeof addr) == -1) { @@ -535,7 +536,7 @@ launch_appliance (guestfs_h *g) /* Set up virtio-serial for the communications channel. */ add_cmdline (g, "-chardev"); - snprintf (buf, sizeof buf, "socket,path=%s,id=channel0", unixsock); + snprintf (buf, sizeof buf, "socket,path=%s,id=channel0", guestfsd_sock); add_cmdline (g, buf); add_cmdline (g, "-device"); add_cmdline (g, "virtserialport,chardev=channel0,name=org.libguestfs.channel.0");